From 3bfafc5f9397893ca247b149091a1ba02167fd6b Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Thu, 23 Dec 2021 17:56:30 +0200 Subject: [PATCH] more cleanup --- samples/ControlCatalog/MainView.xaml.cs | 28 +++++++------------------ 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/samples/ControlCatalog/MainView.xaml.cs b/samples/ControlCatalog/MainView.xaml.cs index d36ec3d272..0579355831 100644 --- a/samples/ControlCatalog/MainView.xaml.cs +++ b/samples/ControlCatalog/MainView.xaml.cs @@ -44,34 +44,22 @@ namespace ControlCatalog var themeStyle = Application.Current.Styles[0]; if (theme == CatalogTheme.FluentLight) { - if (themeStyle is FluentTheme fluentTheme) + if (App.Fluent.Mode != FluentThemeMode.Light) { - if (fluentTheme.Mode == FluentThemeMode.Dark) - { - fluentTheme.Mode = FluentThemeMode.Light; - } - } - else - { - Application.Current.Styles[0] = App.Fluent; - Application.Current.Styles[1] = App.DataGridFluent; + App.Fluent.Mode = FluentThemeMode.Light; } + Application.Current.Styles[0] = App.Fluent; + Application.Current.Styles[1] = App.DataGridFluent; } else if (theme == CatalogTheme.FluentDark) { - if (themeStyle is FluentTheme fluentTheme) - { - if (fluentTheme.Mode == FluentThemeMode.Light) - { - fluentTheme.Mode = FluentThemeMode.Dark; - } - } - else + + if (App.Fluent.Mode != FluentThemeMode.Dark) { App.Fluent.Mode = FluentThemeMode.Dark; - Application.Current.Styles[0] = App.Fluent; - Application.Current.Styles[1] = App.DataGridFluent; } + Application.Current.Styles[0] = App.Fluent; + Application.Current.Styles[1] = App.DataGridFluent; } else if (theme == CatalogTheme.DefaultLight) {