Theme.CreateTheme(Win10Palette) Method
Creates a new Theme with a Win10Palette.
Namespace: DevExpress.Xpf.Core
Assembly: DevExpress.Xpf.Core.v24.2.dll
NuGet Package: DevExpress.Wpf.Core
Declaration
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:
- Creates a theme based on Win10Dark/Win10Light theme depending on the Windows app mode.
- Applies the Windows accent color to the palette.
- 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