예제 #1
0
        private void Watcher_OnThemeChanged(object sender, ThemeWatcher.ThemeChangeEventArgs e)
        {
            CurrentTheme = e.CurrentTheme;

            PrimaryColor           = CurrentTheme == ThemeWatcher.WindowsTheme.Dark ? Colors.White : Colors.Black;
            PrimarySolidColorBrush = new SolidColorBrush(PrimaryColor);

            SecondaryColor           = CurrentTheme == ThemeWatcher.WindowsTheme.Dark ? Colors.Black : Colors.White;
            SecondarySolidColorBrush = new SolidColorBrush(SecondaryColor);

            AccentSolidColorBrush = new SolidColorBrush(e.AccentColor);
            AccentSolidColorBrush.Freeze();

            AccentColor = e.AccentColor;

            Debug.WriteLine("ThemeChange: ***********");
            Debug.WriteLine("Primary: " + PrimaryColor);
            Debug.WriteLine("Secondary: " + SecondaryColor);
            Debug.WriteLine("Accent: " + AccentColor);

            RaiseChanges();
        }
예제 #2
0
 private static void ThemeWatcher_OnThemeChanged(object sender, ThemeWatcher.ThemeChangeEventArgs e)
 {
     WindowsTheme = e.CurrentTheme;
     Accent       = e.AccentColor;
 }