22using CodeHubDesktop . Views ;
33using HandyControl . Data ;
44using HandyControl . Tools ;
5- using ModernWpf ;
65using Prism . Ioc ;
76using Prism . Regions ;
87using System ;
98using System . Windows ;
10- using System . Windows . Media ;
119
1210namespace CodeHubDesktop
1311{
@@ -17,6 +15,10 @@ public App()
1715 {
1816 GlobalData . Init ( ) ;
1917 ConfigHelper . Instance . SetLang ( GlobalData . Config . Lang ) ;
18+ if ( GlobalData . Config . Skin != SkinType . Default )
19+ {
20+ UpdateSkin ( GlobalData . Config . Skin ) ;
21+ }
2022 }
2123
2224 protected override void OnStartup ( StartupEventArgs e )
@@ -27,10 +29,6 @@ protected override void OnStartup(StartupEventArgs e)
2729
2830 protected override Window CreateShell ( )
2931 {
30- if ( GlobalData . Config . Skin != SkinType . Default )
31- {
32- UpdateSkin ( GlobalData . Config . Skin ) ;
33- }
3432 return Container . Resolve < MainWindow > ( ) ;
3533 }
3634
@@ -43,6 +41,7 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)
4341 containerRegistry . RegisterForNavigation < Settings > ( ) ;
4442 containerRegistry . RegisterForNavigation < CreateSnippet > ( ) ;
4543 containerRegistry . RegisterForNavigation < SnippetHistory > ( ) ;
44+ containerRegistry . RegisterForNavigation < SnippetOnline > ( ) ;
4645 containerRegistry . RegisterForNavigation < LeftMainContent > ( ) ;
4746 }
4847 internal void UpdateSkin ( SkinType skin )
@@ -55,22 +54,6 @@ internal void UpdateSkin(SkinType skin)
5554 {
5655 Source = new Uri ( "pack://application:,,,/HandyControl;component/Themes/Theme.xaml" )
5756 } ) ;
58-
59- if ( skin . Equals ( SkinType . Dark ) )
60- {
61- ThemeManager . Current . ApplicationTheme = ApplicationTheme . Dark ;
62- }
63- else if ( skin . Equals ( SkinType . Default ) )
64- {
65- ThemeManager . Current . ApplicationTheme = ApplicationTheme . Light ;
66- }
67- else
68- {
69- ThemeManager . Current . ApplicationTheme = ApplicationTheme . Light ;
70- ThemeManager . Current . AccentColor = ResourceHelper . GetResource < Color > ( ResourceToken . VioletColor ) ;
71-
72- }
73-
7457 }
7558 }
7659}
0 commit comments