Skip to content

Commit

Permalink
fix: wrong demo code
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Jul 28, 2024
1 parent 5f78e6c commit 4424c21
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,22 @@ public partial class App : Application
/// <inheritdoc />
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
}
}
}

0 comments on commit 4424c21

Please sign in to comment.