From 5f5bd7ec6adeb1f76398764437f4f6df46ebe5d5 Mon Sep 17 00:00:00 2001 From: Tsuki Date: Sat, 1 Apr 2023 20:44:17 +0800 Subject: [PATCH] fix autoDark --- v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index 13324c49..34493aa9 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -1716,18 +1716,13 @@ namespace v2rayN.ViewModels { var theme = _paletteHelper.GetTheme(); //add follow systemTheme - var systemTheme = OSAppTheme.Light; - if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile"){ - systemTheme = Application.Current.RequestedTheme; - } - else{ - systemTheme = Windows.UI.Xaml.Application.Current.RequestedTheme; - } - - if (systemTheme == OSAppTheme.Dark){ + var systemTheme = Windows.UI.Xaml.Application.Current.RequestedTheme; + if (systemTheme == ApplicationTheme.Dark) + { isDarkTheme = true; } - else if (systemTheme == OSAppTheme.Light){ + else if (systemTheme == ApplicationTheme.Light) + { isDarkTheme = false; }