All docs
V21.1
21.2 (EAP/Beta)
21.1
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(Nullable<Color>, Boolean) Constructor

Initializes a new instance of the Win10Palette class with specified settings.

Namespace: DevExpress.Xpf.Core

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

Declaration

public Win10Palette(
    Color? accentColor = default(Color? ),
    bool listenAccentColorChanges = true
)

Optional Parameters

Name Type Default Description
accentColor Nullable<Color>

null

null to get the Windows 10 accent color; otherwise, an accent color.

listenAccentColorChanges Boolean

True

true to create and apply a new palette to the Win10Light theme when a user changes the Windows 10 accent color; otherwise, false.

Remarks

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);
}

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

protected override void OnStartup(StartupEventArgs e)
{
    var accentpalette = new Win10Palette((Color)ColorConverter.ConvertFromString("#ffffb900"), false);
    var customtheme = Theme.CreateTheme(accentpalette, Theme.Win10Light);
    Theme.RegisterTheme(customtheme);
    ApplicationThemeHelper.ApplicationThemeName = customtheme.Name;
    base.OnStartup(e);
}

Note

The Win10Palette works only with the Windows 10 OS version.

See Also