Exemple #1
0
        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();
            }
        }
Exemple #2
0
 public StaticSystemThemeDetector(ColorThemeMode mode)
 {
     Mode = mode;
 }