Back to Devexpress

Theme.CreateTheme(ThemePaletteBase, Theme, String, String, String, Uri, Uri, Uri) Method

wpf-devexpress-dot-xpf-dot-core-dot-theme-dot-createtheme-x28-devexpress-dot-xpf-dot-core-dot-themepalettebase-devexpress-dot-xpf-dot-core-dot-theme-system-dot-string-system-dot-string-system-dot-string-system-dot-uri-system-dot-uri-system-dot-uri-x29.md

latest5.8 KB
Original Source

Theme.CreateTheme(ThemePaletteBase, Theme, String, String, String, Uri, Uri, Uri) Method

Creates a new Theme with the specified settings.

Namespace : DevExpress.Xpf.Core

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public static Theme CreateTheme(
    ThemePaletteBase palette,
    Theme baseTheme,
    string themeName = null,
    string fullThemeName = null,
    string category = null,
    Uri smallGlyph = null,
    Uri largeGlyph = null,
    Uri svgGlyph = null
)
vb
Public Shared Function CreateTheme(
    palette As ThemePaletteBase,
    baseTheme As Theme,
    themeName As String = Nothing,
    fullThemeName As String = Nothing,
    category As String = Nothing,
    smallGlyph As Uri = Nothing,
    largeGlyph As Uri = Nothing,
    svgGlyph As Uri = Nothing
) As Theme

Parameters

NameTypeDescription
paletteThemePaletteBase

A ThemePaletteBase that specifies the palette.

| | baseTheme | Theme |

A Theme that specifies the base theme.

|

Optional Parameters

NameTypeDefaultDescription
themeNameStringnull

A String that specifies the theme name.

| | fullThemeName | String | null |

A String that specifies the theme full name.

| | category | String | null |

A String that specifies the name of the theme category.

| | smallGlyph | Uri | null |

A Uri that specifies the uniform resource identifier of the theme small icon.

| | largeGlyph | Uri | null |

A Uri that specifies the uniform resource identifier of the theme large icon.

| | svgGlyph | Uri | null |

A Uri that specifies the uniform resource identifier of the theme vector (SVG) icon.

|

Returns

TypeDescription
Theme

A Theme that specifies the new theme.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateTheme(ThemePaletteBase, Theme, String, String, String, Uri, Uri, Uri) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-create-a-fluent-design-using-appearance-options/CS/FluentDesignTemplate/App.xaml.cs#L34

csharp
custompalette.SetColor("SelectionForeground", (Color)ColorConverter.ConvertFromString("White"));
var customtheme = Theme.CreateTheme(custompalette, Theme.Office2019Black);
Theme.RegisterTheme(customtheme);

wpf-mvvm-behaviors-gallery-based-theme-palette-selector/CS/App.xaml.cs#L12

csharp
customPalette.SetColor("Foreground", Colors.Red);
var customTheme = Theme.CreateTheme(customPalette, Theme.Office2016ColorfulSE);
Theme.RegisterTheme(customTheme);

wpf-create-a-fluent-design-using-appearance-options/VB/FluentDesignTemplate/App.xaml.vb#L29

vb
custompalette.SetColor("SelectionForeground", CType(ColorConverter.ConvertFromString("White"), Color))
Dim customtheme = Theme.CreateTheme(custompalette, Theme.Office2019Black)
Theme.RegisterTheme(customtheme)

wpf-mvvm-behaviors-gallery-based-theme-palette-selector/VB/App.xaml.vb#L14

vb
customPalette.SetColor("Foreground", Colors.Red)
Dim customTheme = Theme.CreateTheme(customPalette, Theme.Office2016ColorfulSE)
Theme.RegisterTheme(customTheme)

See Also

Theme Class

Theme Members

DevExpress.Xpf.Core Namespace