This repository was archived by the owner on Mar 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ namespace RaceControl
3838{
3939 public partial class App
4040 {
41+ private static readonly ResourceDictionary LightTheme = new ( ) { Source = new Uri ( @"/Themes/LightTheme.xaml" , UriKind . Relative ) } ;
42+ private static readonly ResourceDictionary DarkTheme = new ( ) { Source = new Uri ( @"/Themes/DarkTheme.xaml" , UriKind . Relative ) } ;
43+
4144 private readonly SplashScreen _splashScreen = new ( "splashscreen.png" ) ;
4245
4346 private static int _flyleafUniqueId ;
@@ -100,6 +103,12 @@ protected override void RegisterTypes(IContainerRegistry registry)
100103
101104 protected override Window CreateShell ( )
102105 {
106+ var settings = Container . Resolve < ISettings > ( ) ;
107+ settings . Load ( ) ;
108+
109+ App . Current . Resources . MergedDictionaries . Clear ( ) ;
110+ App . Current . Resources . MergedDictionaries . Add ( settings . UseDarkTheme ? DarkTheme : LightTheme ) ;
111+
103112 _splashScreen . Close ( TimeSpan . Zero ) ;
104113
105114 return Container . Resolve < MainWindow > ( ) ;
Original file line number Diff line number Diff line change @@ -291,7 +291,6 @@ public Track SelectedAudioTrack
291291 private void LoadedExecute ( RoutedEventArgs args )
292292 {
293293 IsBusy = true ;
294- Settings . Load ( ) ;
295294 VideoDialogLayout . Load ( ) ;
296295 UpdateThemeCommand . TryExecute ( ) ;
297296 SetVlcExeLocation ( ) ;
You can’t perform that action at this time.
0 commit comments