Skip to main content
All docs
V23.2

Theme.CreateTheme(Win10Palette) Method

Creates a new Theme with a Win10Palette.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v23.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public static Theme CreateTheme(
    Win10Palette palette
)

Parameters

Name Type Description
palette Win10Palette

A Win10Palette instance.

Returns

Type Description
Theme

The new theme.

Example

The code sample below performs the following actions:

  1. Creates a theme based on Win10Dark/Win10Light theme depending on the Windows app mode.
  2. Applies the Windows accent color to the palette.
  3. Applies the theme on application startup.
protected override void OnStartup(StartupEventArgs e) {
    var palette = new Win10Palette(true);
    var theme = Theme.CreateTheme(palette);
    Theme.RegisterTheme(theme);
    ApplicationThemeHelper.ApplicationThemeName = theme.Name;
    base.OnStartup(e);
}
See Also