diff --git a/RaceControl/RaceControl.Core/Controls/BusyIndicator.xaml b/RaceControl/RaceControl.Core/Controls/BusyIndicator.xaml index 54b918d9..8138c614 100644 --- a/RaceControl/RaceControl.Core/Controls/BusyIndicator.xaml +++ b/RaceControl/RaceControl.Core/Controls/BusyIndicator.xaml @@ -3,8 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - Background="#60DDDDDD"> + VerticalAlignment="Stretch"> SetProperty(ref _enableMpvAutoSync, value); } + public bool UseDarkTheme + { + get => _useDarkTheme; + set => SetProperty(ref _useDarkTheme, value); + } + public string AdditionalMpvParameters { get => _additionalMpvParameters; diff --git a/RaceControl/RaceControl/App.xaml b/RaceControl/RaceControl/App.xaml index 95e3a155..98734b1c 100644 --- a/RaceControl/RaceControl/App.xaml +++ b/RaceControl/RaceControl/App.xaml @@ -3,4 +3,12 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prism="http://prismlibrary.com/" - DispatcherUnhandledException="PrismApplication_DispatcherUnhandledException" /> \ No newline at end of file + DispatcherUnhandledException="PrismApplication_DispatcherUnhandledException"> + + + + + + + + \ No newline at end of file diff --git a/RaceControl/RaceControl/App.xaml.cs b/RaceControl/RaceControl/App.xaml.cs index d28f3884..de7e2c61 100644 --- a/RaceControl/RaceControl/App.xaml.cs +++ b/RaceControl/RaceControl/App.xaml.cs @@ -41,6 +41,9 @@ namespace RaceControl { public partial class App { + private static readonly ResourceDictionary LightTheme = new() { Source = new Uri(@"/Themes/LightTheme.xaml", UriKind.Relative) }; + private static readonly ResourceDictionary DarkTheme = new() { Source = new Uri(@"/Themes/DarkTheme.xaml", UriKind.Relative) }; + private readonly SplashScreen _splashScreen = new("splashscreen.png"); private static int _flyleafUniqueId; @@ -100,6 +103,12 @@ protected override void RegisterTypes(IContainerRegistry registry) protected override Window CreateShell() { + var settings = Container.Resolve(); + settings.Load(); + + App.Current.Resources.MergedDictionaries.Clear(); + App.Current.Resources.MergedDictionaries.Add(settings.UseDarkTheme ? DarkTheme : LightTheme); + _splashScreen.Close(TimeSpan.Zero); return Container.Resolve(); diff --git a/RaceControl/RaceControl/Themes/DarkTheme.xaml b/RaceControl/RaceControl/Themes/DarkTheme.xaml new file mode 100644 index 00000000..d7cb7a81 --- /dev/null +++ b/RaceControl/RaceControl/Themes/DarkTheme.xaml @@ -0,0 +1,5346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +