From 4a098cc071d69138782327154a0422783af1e008 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sun, 8 Mar 2026 21:30:02 +1100 Subject: [PATCH] Merge pull request #4313 from Flow-Launcher/InitProgressbarAnimation_Null Move progress bar animation init to Loaded event to fix possible null exception of ProgressBar --- Flow.Launcher/MainWindow.xaml | 1 + Flow.Launcher/MainWindow.xaml.cs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 747975b2a..9d6b51dcc 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -342,6 +342,7 @@ Margin="12 0 12 0" HorizontalAlignment="Center" VerticalAlignment="Bottom" + Loaded="ProgressBar_Loaded" StrokeThickness="2" Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" X1="-100" diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 942cccbe9..735e8188a 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -199,9 +199,6 @@ namespace Flow.Launcher ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark; } - // Initialize position - InitProgressbarAnimation(); - // Force update position UpdatePosition(); @@ -353,6 +350,11 @@ namespace Flow.Launcher } } + private void ProgressBar_Loaded(object sender, RoutedEventArgs e) + { + InitProgressbarAnimation(); + } + private async void OnClosing(object sender, CancelEventArgs e) { if (!CanClose)