2026-11-29 18:20:04 +01:00
|
|
|
|
#nullable enable
|
2026-11-25 14:52:25 +01:00
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
using Microsoft.Win32;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ReminderOrganizer.Core
|
|
|
|
|
|
{
|
2026-11-29 18:20:04 +01:00
|
|
|
|
/// <summary>Windows settings the app follows until the user picks something (theme).</summary>
|
2026-11-25 14:52:25 +01:00
|
|
|
|
public static class SystemPrefs
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public static bool IsDarkMode()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
|
|
|
|
|
|
return key?.GetValue("AppsUseLightTheme") is int v && v == 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|