private static void OnThemeChanged(Themes theme, ForegroundColorVariations colorVariation) { if (ThemeChanged != null) { ThemeChanged(null, new AppearanceChangedEventArgs(theme, colorVariation)); } }
public static void ChangeAppearance(Themes theme, ForegroundColorVariations foregroundColorVariation) { string analyticsFeatureName = string.Concat(EqatecConstants.Theme, ".", theme.ToString()); EqatecMonitor.Instance.TrackFeature(analyticsFeatureName); switch (foregroundColorVariation) { case ForegroundColorVariations.Light: ThemePalette.Palette.Foreground = ThemePalette.LightForegroundColor; break; case ForegroundColorVariations.Dark: ThemePalette.Palette.Foreground = ThemePalette.DarkForegroundColor; break; case ForegroundColorVariations.ExpressionDark: ThemePalette.Palette.Foreground = ThemePalette.ExpressionDarkForegroundColor; break; case ForegroundColorVariations.Windows7: ThemePalette.Palette.Foreground = ThemePalette.Windows7ForegroundColor; break; default: break; } string themeAssembly = GetThemeAssemblyName(theme.ToString()); SetTheme(themeAssembly); SetThemeSpecific(theme); SetIconsSet(theme); OnThemeChanged(theme, foregroundColorVariation); }
private void ChangeTheme(object parameter) { var commandParameter = parameter as AppearanceCommandParameter; if (ApplicationThemeViewModel.SelectedTheme == commandParameter.Theme.ToString() && this.ForegroundColorVariation == commandParameter.ColorVariation) { return; } this.CurrentTheme = commandParameter.Theme; ApplicationThemeViewModel.SelectedTheme = this.CurrentTheme.ToString(); this.ForegroundColorVariation = commandParameter.ColorVariation; AppearanceManager.ChangeAppearance(this.CurrentTheme, this.ForegroundColorVariation); }
public AppearanceChangedEventArgs(Themes theme, ForegroundColorVariations colorVariation) { this.Theme = theme; this.ColorVariation = colorVariation; }