mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-30 10:19:51 +08:00
23 lines
641 B
C#
23 lines
641 B
C#
using MicaSetup.Natives;
|
|
using Microsoft.Win32;
|
|
|
|
namespace MicaSetup.Design.Controls;
|
|
|
|
public class ApplicationThemeManager
|
|
{
|
|
public static ApplicationTheme GetAppTheme()
|
|
{
|
|
using RegistryKey? key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
|
|
object? registryValueObject = key?.GetValue("AppsUseLightTheme");
|
|
|
|
if (registryValueObject == null)
|
|
{
|
|
return ApplicationTheme.Light;
|
|
}
|
|
|
|
var registryValue = (int)registryValueObject;
|
|
|
|
return registryValue > 0 ? ApplicationTheme.Light : ApplicationTheme.Dark;
|
|
}
|
|
}
|