DxTheme Class
Defines a theme for DevExpress Blazor UI Controls (our proprietary Classic theme or a Bootstrap theme).
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public class DxTheme :
DxThemeBase<ThemeProperties>
Remarks
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:
- Name
- Returns the theme name that serves as a unique theme identifier.
- GetFilePaths()
- Returns theme stylesheet paths.
- GetStyles()
- Returns
<style>
element content in HTML format.
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>
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