Skip to content

Commit a2f2242

Browse files
committed
Move progress bar animation init to Loaded event
InitProgressbarAnimation is now triggered by the progress bar's Loaded event instead of during main window initialization. This ensures the animation starts only after the progress bar is fully loaded, improving reliability and preventing potential UI timing issues.
1 parent dda9000 commit a2f2242

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Flow.Launcher/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
Margin="12 0 12 0"
343343
HorizontalAlignment="Center"
344344
VerticalAlignment="Bottom"
345+
Loaded="ProgressBar_Loaded"
345346
StrokeThickness="2"
346347
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
347348
X1="-100"

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ private void OnLoaded(object sender, RoutedEventArgs e)
199199
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
200200
}
201201

202-
// Initialize position
203-
InitProgressbarAnimation();
204-
205202
// Force update position
206203
UpdatePosition();
207204

@@ -354,6 +351,11 @@ private void OnLoaded(object sender, RoutedEventArgs e)
354351
}
355352
}
356353

354+
private void ProgressBar_Loaded(object sender, RoutedEventArgs e)
355+
{
356+
InitProgressbarAnimation();
357+
}
358+
357359
private async void OnClosing(object sender, CancelEventArgs e)
358360
{
359361
if (!CanClose)

0 commit comments

Comments
 (0)