Skip to content

Commit d7d17a9

Browse files
committed
Use ActualApplicationThemeChanged in MainWindow
1 parent 5b2b272 commit d7d17a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using Flow.Launcher.Infrastructure.Hotkey;
2121
using Flow.Launcher.Infrastructure.Image;
2222
using Flow.Launcher.Infrastructure.UserSettings;
23+
using Flow.Launcher.Plugin;
2324
using Flow.Launcher.Plugin.SharedCommands;
2425
using Flow.Launcher.ViewModel;
2526
using Microsoft.Win32;
@@ -91,8 +92,8 @@ public MainWindow()
9192

9293
InitSoundEffects();
9394
DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste);
94-
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged += ThemeManager_ActualApplicationThemeChanged;
9595
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
96+
_viewModel.ActualApplicationThemeChanged += ViewModel_ActualApplicationThemeChanged;
9697
}
9798

9899
#endregion
@@ -101,7 +102,7 @@ public MainWindow()
101102

102103
#pragma warning disable VSTHRD100 // Avoid async void methods
103104

104-
private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager sender, object args)
105+
private void ViewModel_ActualApplicationThemeChanged(object sender, ActualApplicationThemeChangedEventArgs args)
105106
{
106107
_ = _theme.RefreshFrameAsync();
107108
}
@@ -1351,7 +1352,7 @@ protected virtual void Dispose(bool disposing)
13511352
_notifyIcon?.Dispose();
13521353
animationSoundWMP?.Close();
13531354
animationSoundWPF?.Dispose();
1354-
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged;
1355+
_viewModel.ActualApplicationThemeChanged -= ViewModel_ActualApplicationThemeChanged;
13551356
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
13561357
}
13571358

0 commit comments

Comments
 (0)