From 4424c2112dae29f98bd2162238da87303aa7b82a Mon Sep 17 00:00:00 2001 From: punker76 Date: Sun, 28 Jul 2024 23:24:54 +0200 Subject: [PATCH] fix: wrong demo code --- .../MahApps.Metro.Demo/App.xaml.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs index 6409d4285..01d8d50c4 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs @@ -15,25 +15,22 @@ public partial class App : Application /// protected override void OnStartup(StartupEventArgs e) { - ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithAppMode; + base.OnStartup(e); + + ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncAll; + ThemeManager.Current.SyncTheme(); - ThemeManager.Current.ThemeChanged += HandleThemeChanged; + ThemeManager.Current.ThemeChanged += CurrentOnThemeChanged; #pragma warning disable CS0618 // Type or member is obsolete AppModeHelper.SyncAppMode(); -#pragma warning restore CS0618 // Type or member is obsolete - - base.OnStartup(e); - - return; - void HandleThemeChanged(object? sender, ThemeChangedEventArgs themeChangedEventArgs) + void CurrentOnThemeChanged(object? sender, ThemeChangedEventArgs themeChangedEventArgs) { -#pragma warning disable CS0618 // Type or member is obsolete AppModeHelper.SyncAppMode(); -#pragma warning restore CS0618 // Type or member is obsolete } +#pragma warning restore CS0618 // Type or member is obsolete } } } \ No newline at end of file