From 0c76752ac0c35f94d1e64e261708a2a910503354 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 12 Jul 2021 16:37:12 -0700 Subject: [PATCH] Fix UI thread issues --- RedBookPlayer.GUI/ViewModels/PlayerViewModel.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/RedBookPlayer.GUI/ViewModels/PlayerViewModel.cs b/RedBookPlayer.GUI/ViewModels/PlayerViewModel.cs index 73fd911..41edc50 100644 --- a/RedBookPlayer.GUI/ViewModels/PlayerViewModel.cs +++ b/RedBookPlayer.GUI/ViewModels/PlayerViewModel.cs @@ -647,7 +647,15 @@ namespace RedBookPlayer.GUI.ViewModels ApplyDeEmphasis = _player.ApplyDeEmphasis; Volume = _player.Volume; - Dispatcher.UIThread.InvokeAsync(() => + UpdateDigits(); + } + + /// + /// Update UI + /// + private void UpdateDigits() + { + Dispatcher.UIThread.Post(() => { string digitString = GenerateDigitString() ?? string.Empty.PadLeft(20, '-'); for(int i = 0; i < _digits.Length; i++)