WPF 获取系统主题色
系统强调色
系统强调色可通过 DwmGetColorizationColor [^DwmGetColorizationColor] 实现 [^DwmGetColorizationColor]: DwmGetColorizationColor 函数
颜色模式
通过访问注册表实现
cs
if (Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize")?.GetValue("AppsUseLightTheme") is not int or > 0)
{
// 浅色模式
}
else
{
// 深色模式
}