From 968725118076e326b5e69ac722fbf581d3b7c76a Mon Sep 17 00:00:00 2001 From: Davide Giacometti Date: Thu, 14 Sep 2023 10:35:39 +0200 Subject: [PATCH] fix custom app theme detection --- src/Wpf.Ui/Appearance/SystemThemeManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Appearance/SystemThemeManager.cs b/src/Wpf.Ui/Appearance/SystemThemeManager.cs index de7bff5a7..193d10052 100644 --- a/src/Wpf.Ui/Appearance/SystemThemeManager.cs +++ b/src/Wpf.Ui/Appearance/SystemThemeManager.cs @@ -115,12 +115,16 @@ private static SystemTheme GetCurrentSystemTheme() "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme", 1 - ) ?? 1; + ); if (rawAppsUseLightTheme is 0) { return SystemTheme.Dark; } + else if (rawAppsUseLightTheme is 1) + { + return SystemTheme.Light; + } var rawSystemUsesLightTheme = Registry.GetValue(