void DetectTheme() { NSAppearance appearance = Window.ContentView.EffectiveAppearance; string basicAppearance = appearance?.FindBestMatch(new [] { NSAppearance.NameAqua.ToString(), NSAppearance.NameDarkAqua.ToString() }); var value = NSAppearance.NameDarkAqua == basicAppearance ? ColorThemeMode.Dark : ColorThemeMode.Light;; if (value != colorThemeMode) { colorThemeMode = value; viewModel?.ChangeNotification.Post(); } }
public StaticSystemThemeDetector(ColorThemeMode mode) { Mode = mode; }