blazor-devexpress-dot-blazor-ba31318f.md
Defines a theme for DevExpress Blazor UI Controls (our proprietary Classic theme or a Bootstrap theme).
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.Resources.v25.2.dll
NuGet Package : DevExpress.Blazor.Resources
public sealed class DxTheme :
DxThemeBase<ThemeProperties>
Use DxTheme API members to obtain information about a theme - our proprietary Classic theme ( Blazing Berry , Blazing Dark , Office White , or Purple ) or Bootstrap theme. Note that Fluent themes are defined by a separate class - DxThemeFluent.
DxTheme APIs include:
NameReturns the theme name that serves as a unique theme identifier.GetFilePaths()Returns theme stylesheet paths.
You can also call the DxTheme.Clone() method to clone a built-in classic theme or apply an external Bootstrap theme.
<head>
@*...*@
@DxResourceManager.RegisterTheme(Themes.OfficeWhite.Clone(properties => {
properties.Name = "Office White Custom";
properties.AddFilePaths("css/OWCustomStyles.css")
}))
</head>
<head>
@*...*@
@DxResourceManager.RegisterTheme(Themes.BootstrapExternal.Clone(properties => {
properties.Name = "Pulse Bootswatch";
properties.AddFilePaths("css/pulse/bootstrap.min.css");
}))
</head>
Tip
You can create and register a custom theme using the DxTheme constructor and a RegisterTheme(ITheme) method call:
<head>
@*...*@
@DxResourceManager.RegisterTheme(customTheme)
</head>
@code{
ITheme customTheme = new DxTheme("MyCustomTheme", ["css/theme.css", "css/theme-color.css"]);
}
Use the DxTheme constructor to create a custom
Object DxThemeBase<ThemeProperties> DxTheme
See Also