mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use ActualApplicationThemeChanged in MainWindow
This commit is contained in:
parent
5b2b272f76
commit
d7d17a93cd
1 changed files with 4 additions and 3 deletions
|
|
@ -20,6 +20,7 @@ using Flow.Launcher.Infrastructure;
|
|||
using Flow.Launcher.Infrastructure.Hotkey;
|
||||
using Flow.Launcher.Infrastructure.Image;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using Flow.Launcher.Plugin;
|
||||
using Flow.Launcher.Plugin.SharedCommands;
|
||||
using Flow.Launcher.ViewModel;
|
||||
using Microsoft.Win32;
|
||||
|
|
@ -91,8 +92,8 @@ namespace Flow.Launcher
|
|||
|
||||
InitSoundEffects();
|
||||
DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste);
|
||||
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged += ThemeManager_ActualApplicationThemeChanged;
|
||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||
_viewModel.ActualApplicationThemeChanged += ViewModel_ActualApplicationThemeChanged;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -101,7 +102,7 @@ namespace Flow.Launcher
|
|||
|
||||
#pragma warning disable VSTHRD100 // Avoid async void methods
|
||||
|
||||
private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager sender, object args)
|
||||
private void ViewModel_ActualApplicationThemeChanged(object sender, ActualApplicationThemeChangedEventArgs args)
|
||||
{
|
||||
_ = _theme.RefreshFrameAsync();
|
||||
}
|
||||
|
|
@ -1351,7 +1352,7 @@ namespace Flow.Launcher
|
|||
_notifyIcon?.Dispose();
|
||||
animationSoundWMP?.Close();
|
||||
animationSoundWPF?.Dispose();
|
||||
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged;
|
||||
_viewModel.ActualApplicationThemeChanged -= ViewModel_ActualApplicationThemeChanged;
|
||||
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue