Back to Devexpress

DxTheme Class

blazor-devexpress-dot-blazor-ba31318f.md

latest2.8 KB
Original Source

DxTheme Class

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

Declaration

csharp
public sealed 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:

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.

razor
<head>
    @*...*@
    @DxResourceManager.RegisterTheme(Themes.OfficeWhite.Clone(properties => {
        properties.Name = "Office White Custom";
        properties.AddFilePaths("css/OWCustomStyles.css")
    }))
</head>
razor
<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:

razor
<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

Implements

ITheme

Inheritance

Object DxThemeBase<ThemeProperties> DxTheme

See Also

DxTheme Members

DevExpress.Blazor Namespace