Skip to main content
A newer version of this page is available. .
All docs
V20.2

Win10Palette(Nullable<Color>, Boolean) Constructor

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

Namespace: DevExpress.Xpf.Core

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Core, DevExpress.Wpf.Core

Declaration

public Win10Palette(
    Color? accentColor = null,
    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