All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Win10Palette Class

A Windows 10 theme palette. Win10Palette can get the Windows 10 accent color and update the theme each time a user changes this color.

Namespace: DevExpress.Xpf.Core

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

Declaration

public sealed class Win10Palette :
    ThemePalette
Public NotInheritable Class Win10Palette
    Inherits ThemePalette

Remarks

You can create a Windows10Light theme with Win10Palette. The Win10Palette constructor has two parameters: accentColor and listenAccentColorChanges.

Pass a Color value to the accentColor constructor parameter to specify the palette accent color or leave the parameter empty to use the Windows 10 accent color.

When the listenAccentColorChanges constructor parameter is true, the Win10Palette performs the following actions:

  • Gets a new accent color when a user changes the Windows 10 accent color.
  • Creates a new theme.
  • Applies the theme to an application.

Set the listenAccentColorChanges constructor parameter to false to stop getting a new accent color when a user changes the Windows 10 accent color.

NOTE

The Win10Palette works only with the Windows 10 OS version. If the Win10Palette has not found the Windows accent color, the application accent color is set to #FF0078D7.

Example

The following code sample creates a new Win10Light theme with the Windows 10 accent color and applies the theme on application startup:

protected override void OnStartup(StartupEventArgs e)
{
    var accentpalette = new Win10Palette();
    var customtheme = Theme.CreateTheme(accentpalette, Theme.Win10Light);
    Theme.RegisterTheme(customtheme);
    ApplicationThemeHelper.ApplicationThemeName = customtheme.Name;
    base.OnStartup(e);
}

WPF Themes - Palettes in Ribbon Gallery

Inheritance

See Also