From 2c1e39f3131794e4062df3440ecd45c35486c4a2 Mon Sep 17 00:00:00 2001 From: Sparrkle Date: Tue, 4 Oct 2022 16:45:02 +0900 Subject: [PATCH] Fixed Progressbar Dispatcher Exception --- Flow.Launcher/MainWindow.xaml.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index bc952681d95..332e0f5024a 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -138,22 +138,20 @@ private void OnLoaded(object sender, RoutedEventArgs _) } case nameof(MainViewModel.ProgressBarVisibility): { - Dispatcher.Invoke(async () => + Dispatcher.Invoke(() => { if (_viewModel.ProgressBarVisibility == Visibility.Hidden && !isProgressBarStoryboardPaused) { - await Task.Delay(50); _progressBarStoryboard.Stop(ProgressBar); isProgressBarStoryboardPaused = true; } else if (_viewModel.MainWindowVisibilityStatus && - isProgressBarStoryboardPaused) + isProgressBarStoryboardPaused) { _progressBarStoryboard.Begin(ProgressBar, true); isProgressBarStoryboardPaused = false; } - }, System.Windows.Threading.DispatcherPriority.Render); - + }); break; } case nameof(MainViewModel.QueryTextCursorMovedToEnd):