Skip to main content
A newer version of this page is available. .

ThemePalette Class

A WPF Theme palette.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v19.1.dll

Declaration

public class ThemePalette :
    ThemePaletteBase

Remarks

Create and Customize a Palette

Create a palette instance and use the SetColor method to set color values to palette colors. The code snippet below changes the SelectionBackground and Foreground palette colors:

var mypalette = new ThemePalette("CustomPalette");
mypalette.SetColor(“SelectionBackground”, Colors.Red);
mypalette.SetColor(“Foreground”, Colors.Black);

Create a Theme with the Palette

To apply a dynamic palette to an application, you should create a new theme. This theme should be based on a Theme with a Palette. Specify the base theme and the dynamic palette name and use the CreateTheme method to create a new theme assembly.

var customtheme = Theme.CreateTheme(mypalette, Theme.Office2016ColorfulSE);

Apply the Palette to an Application

Register the created theme and apply it to an application.

Theme.RegisterTheme(customtheme);
ApplicationThemeHelper.ApplicationThemeName = customtheme.Name;

Inheritance

See Also