private void Button_Click(object sender, RoutedEventArgs e) { var custompalette = new ThemePalette("CustomPalette"); custompalette.SetColor("Foreground", (Color)ColorConverter.ConvertFromString("#FFFF7200")); custompalette.SetColor("Backstage.Focused", Colors.White); var customtheme = Theme.CreateTheme(custompalette, Theme.Office2016ColorfulSE); Theme.RegisterTheme(customtheme); ApplicationThemeHelper.ApplicationThemeName = customtheme.Name; }
public static void Register(string name, string fullName, string baseColor, string lightColor, string darkColor) { ThemePalette palette = new ThemePalette(name); palette.SetColor("Border", (Color)ColorConverter.ConvertFromString("#FF484848")); palette.SetColor("Delimeter", (Color)ColorConverter.ConvertFromString("#FF484848")); palette.SetColor("HoverBorder", (Color)ColorConverter.ConvertFromString("#FF404040")); palette.SetColor("HoverBackground", (Color)ColorConverter.ConvertFromString("#FF404040")); palette.SetColor("Button.Background", (Color)ColorConverter.ConvertFromString("#FF404040")); palette.SetColor("Editor.Background", (Color)ColorConverter.ConvertFromString("#FF282828")); palette.SetColor("Window.Background", (Color)ColorConverter.ConvertFromString("#FF282828")); palette.SetColor("Control.Background", (Color)ColorConverter.ConvertFromString("#FF282828")); palette.SetColor("Focused", (Color)ColorConverter.ConvertFromString(baseColor)); palette.SetColor("SelectionBorder", (Color)ColorConverter.ConvertFromString(baseColor)); palette.SetColor("SelectionBackground", (Color)ColorConverter.ConvertFromString(baseColor)); palette.SetColor("Backstage.Window.Background", (Color)ColorConverter.ConvertFromString(baseColor)); palette.SetColor("Backstage.Delimeter", (Color)ColorConverter.ConvertFromString(lightColor)); palette.SetColor("Backstage.HoverBackground", (Color)ColorConverter.ConvertFromString(lightColor)); palette.SetColor("Backstage.Button.Background", (Color)ColorConverter.ConvertFromString(lightColor)); palette.SetColor("Backstage.Editor.Background", (Color)ColorConverter.ConvertFromString(darkColor)); palette.SetColor("Backstage.SelectionBackground", (Color)ColorConverter.ConvertFromString(darkColor)); Theme theme = Theme.CreateTheme(palette, Theme.VS2017Dark, null, fullName, baseColor); Theme.RegisterTheme(theme); }
protected override void OnStartup(StartupEventArgs e) { var custompalette = new ThemePalette("CustomPalette"); custompalette.SetColor("Foreground", Colors.White); custompalette.SetColor("Focused", (Color)ColorConverter.ConvertFromString("#A04B647A")); custompalette.SetColor("HoverBackground", (Color)ColorConverter.ConvertFromString("#1FFFFFFF")); custompalette.SetColor("HoverBorder", (Color)ColorConverter.ConvertFromString("#1FFFFFFF")); custompalette.SetColor("Border", (Color)ColorConverter.ConvertFromString("#4F0B0A15")); custompalette.SetColor("SelectionBackground", (Color)ColorConverter.ConvertFromString("#5E8B99A3")); custompalette.SetColor("SelectionBorder", (Color)ColorConverter.ConvertFromString("#5E8B99A3")); custompalette.SetColor("ControlLight.SelectionBackground", (Color)ColorConverter.ConvertFromString("#5E8B99A3")); custompalette.SetColor("Control.SelectionBackground", (Color)ColorConverter.ConvertFromString("#5E8B99A3")); custompalette.SetColor("Control.HoverBackground", (Color)ColorConverter.ConvertFromString("#2E8B99A3")); custompalette.SetColor("Editor.Background", (Color)ColorConverter.ConvertFromString("#FF70787E")); custompalette.SetColor("Window.Background", (Color)ColorConverter.ConvertFromString("#FF70787E")); custompalette.SetColor("Button.Background", (Color)ColorConverter.ConvertFromString("#4F0B0A15")); custompalette.SetColor("SelectionForeground", (Color)ColorConverter.ConvertFromString("White")); var customtheme = Theme.CreateTheme(custompalette, Theme.Office2019Black); Theme.RegisterTheme(customtheme); ApplicationThemeHelper.ApplicationThemeName = customtheme.Name; base.OnStartup(e); }