WPF 获取系统主题色
2020年6月14日小于 1 分钟约 122 字
WPF 获取系统主题色
系统强调色
系统强调色可通过 DwmGetColorizationColor [1] 实现
颜色模式
通过访问注册表实现
if (Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize")?.GetValue("AppsUseLightTheme") is not int or > 0)
{
// 浅色模式
}
else
{
// 深色模式
}