mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-17 02:31:28 -07:00
Improve querying of app theme preference
This commit is contained in:
parent
83e3c487a9
commit
6e8faff624
@ -9,15 +9,10 @@ namespace Bloxstrap.Extensions
|
|||||||
if (dialogTheme != Theme.Default)
|
if (dialogTheme != Theme.Default)
|
||||||
return dialogTheme;
|
return dialogTheme;
|
||||||
|
|
||||||
RegistryKey? key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
|
using var key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
|
||||||
|
|
||||||
if (key is not null)
|
if (key?.GetValue("AppsUseLightTheme") is int value && value == 0)
|
||||||
{
|
return Theme.Dark;
|
||||||
var value = key.GetValue("AppsUseLightTheme");
|
|
||||||
|
|
||||||
if (value is not null && (int)value == 0)
|
|
||||||
return Theme.Dark;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Theme.Light;
|
return Theme.Light;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user