[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Collapse]Common Concepts
  [Collapse]Themes
    Theme List
    Palettes
    Customize Themes
  [Expand]Images
  [Expand]Printing and Exporting
  [Expand]Saving and Restoring Layouts
   Typed Styles
  [Expand]Touch Support
  [Expand]Expressions
   Filtering
  [Expand]Formatting Values
   Prism Adapters
  [Expand]Data Sources
  [Expand]Performance Improvement
   XAML Namespaces
 [Expand]MVVM Framework
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Palettes

Palettes allow you to integrate corporate colors into your application and expand variety of themes. You can create a custom palette or use the predefined palettes.

The Palette is a list of named colors. Each named color has the ColorName and Color values. You can use the ColorName to assign the Color to any number of UI elements:

The following DevExpress WPF Themes contain palettes:

Theme Family Themes
Office 2019 Black, Colorful, Dark Gray, White
Office 2016 SE Black, Colorful, Dark Gray, White
Visual Studio 2017 Blue, Dark, Light

Expanded Predefined Palettes

Palette Themes include the following predefined palettes (see PredefinedThemePalettes):

Apply a Palette in Code

Note

The application does not unload the loaded theme assemblies when you switch themes.

  1. Reference the Mono.cecil NuGet package in your project.
  2. Call the Theme.RegisterPredefinedPaletteThemes method to enable predefined palettes.
  3. Set the ApplicationThemeHelper.ApplicationThemeName property to a combination of a predefined palette name + a base theme name.

The code sample above enables all available palettes for the current theme. To enable and apply a single palette:

  1. Reference the Mono.cecil NuGet package in your project.
  2. Pass the palette and a base theme to the Theme.CreateTheme method to create a new theme.
  3. Pass the theme to the Theme.RegisterTheme method.
  4. Set the ApplicationThemeHelper.ApplicationThemeName property to the theme's name.

Display Palettes in the Ribbon Gallery

You can display predefined palettes in the Ribbon Gallery to allow users to select a palette and apply it to the current theme:

  1. Reference the DevExpress.Mvvm.v19.1.dll assembly.
  2. Call the Theme.RegisterPredefinedPaletteThemes method at application startup to enable these palettes:

  3. Attach the RibbonGalleryItemThemePaletteSelectorBehavior to a RibbonGalleryBarItem (see RibbonGalleryBarItem):

Expanded Custom Palettes

Refer to the Theme Designer's Edit Palette Colors topic for more information on how to create a custom theme palette.

You can export your palette in the following ways:

Edit Palettes in Code

Note

The application does not unload the loaded theme assemblies when you switch themes.

To apply a custom palette to an application:

  1. Reference the Mono.cecil NuGet package in your project.
  2. Create a new DevExpress.Xpf.Core.ThemePalette.%23ctor(System.String,DevExpress.Xpf.Core.ThemePaletteBase) instance:

    ... or create a new DevExpress.Xpf.Core.ThemePalette.%23ctor(System.String,DevExpress.Xpf.Core.ThemePaletteBase) instance based on a predefined palette. In this case, the new palette inherits a predefined palette's colors:

  3. Use the ThemePalette.SetColor method to specify new colors:

  1. Pass the palette and a theme with palette support to the Theme.CreateTheme method to create a new theme:

  2. Pass the theme to the Theme.RegisterTheme method and set the ApplicationThemeHelper.ApplicationThemeName to the theme's name to apply the theme to an application:

The full code sample:

Expanded See Also

Is this topic helpful?​​​​​​​