11using HandyControl . Controls ;
2- using HandyControl . Data ;
3- using HandyControl . Themes ;
4- using HandyControl . Tools ;
52using HandyWinGet . Data ;
63using Microsoft . AppCenter ;
74using Microsoft . AppCenter . Analytics ;
85using Microsoft . AppCenter . Crashes ;
9- using ModernWpf ;
106using System ;
117using System . IO ;
128using System . Runtime ;
139using System . Windows ;
10+ using ApplicationTheme = HandyControl . Themes . ApplicationTheme ;
1411
1512namespace HandyWinGet
1613{
@@ -35,9 +32,9 @@ protected override void OnStartup(StartupEventArgs e)
3532 {
3633 base . OnStartup ( e ) ;
3734 GlobalDataHelper < AppConfig > . Init ( $ "{ AppDomain . CurrentDomain . BaseDirectory } AppConfig.json") ;
38- if ( GlobalDataHelper < AppConfig > . Config . Skin != SkinType . Default )
35+ if ( GlobalDataHelper < AppConfig > . Config . Theme != ApplicationTheme . Light )
3936 {
40- UpdateSkin ( GlobalDataHelper < AppConfig > . Config . Skin ) ;
37+ UpdateSkin ( GlobalDataHelper < AppConfig > . Config . Theme ) ;
4138 }
4239
4340 var boot = new Bootstrapper ( ) ;
@@ -47,14 +44,11 @@ protected override void OnStartup(StartupEventArgs e)
4744 typeof ( Analytics ) , typeof ( Crashes ) ) ;
4845 }
4946
50- public void UpdateSkin ( SkinType skin )
47+ public void UpdateSkin ( ApplicationTheme theme )
5148 {
52- SharedResourceDictionary . SharedDictionaries . Clear ( ) ;
53- ResourceHelper . GetTheme ( "hcTheme" , Resources ) . Skin = skin ;
49+ HandyControl . Themes . ThemeManager . Current . ApplicationTheme = theme ;
5450
55- ThemeManager . Current . ApplicationTheme = skin == SkinType . Dark ? ApplicationTheme . Dark : ApplicationTheme . Light ;
56-
57- Current . MainWindow ? . OnApplyTemplate ( ) ;
51+ ModernWpf . ThemeManager . Current . ApplicationTheme = theme == ApplicationTheme . Dark ? ModernWpf . ApplicationTheme . Dark : ModernWpf . ApplicationTheme . Light ;
5852 }
5953 }
6054}
0 commit comments