From 6ae7acd2934cc31bc64ff047638f6fbc22f60cc9 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Fri, 10 Aug 2018 21:21:50 +0300 Subject: [PATCH] theme switch --- FoxTube/App.xaml.cs | 2 -- FoxTube/Pages/SettingsPages/General.xaml.cs | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/FoxTube/App.xaml.cs b/FoxTube/App.xaml.cs index eb5371f..d5382f5 100644 --- a/FoxTube/App.xaml.cs +++ b/FoxTube/App.xaml.cs @@ -42,8 +42,6 @@ namespace FoxTube case 1: RequestedTheme = ApplicationTheme.Dark; break; - case 2: - break; } } catch { } this.InitializeComponent(); diff --git a/FoxTube/Pages/SettingsPages/General.xaml.cs b/FoxTube/Pages/SettingsPages/General.xaml.cs index 1674cc7..1ce13e7 100644 --- a/FoxTube/Pages/SettingsPages/General.xaml.cs +++ b/FoxTube/Pages/SettingsPages/General.xaml.cs @@ -107,7 +107,11 @@ namespace FoxTube.Pages.SettingsPages if (sender == system) { settings.Values["themeMode"] = 2; - Application.Current.RequestedTheme = ApplicationTheme.; + string uiTheme = (new Windows.UI.ViewManagement.UISettings()).GetColorValue(Windows.UI.ViewManagement.UIColorType.Background).ToString(); + if (uiTheme == "#FF000000") + Application.Current.RequestedTheme = ApplicationTheme.Dark; + else + Application.Current.RequestedTheme = ApplicationTheme.Light; } } }