DxThemeBase<TProps>.Clone(Action<TProps>) Method
Clones a built-in DevExpress Blazor theme or applies a Bootstrap external theme.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.Resources.v25.2.dll
NuGet Package: DevExpress.Blazor.Resources
Declaration
public ITheme Clone(
Action<TProps> modifier
)
Parameters
| Name | Type | Description |
|---|---|---|
| modifier | Action<TProps> | A delegate method that configures theme properties. |
Returns
| Type | Description |
|---|---|
| ITheme | The theme. |
Remarks
Call the RegisterTheme(ITheme) method in the App.razor file to register a theme in your Blazor application. You can choose a theme from the built-in theme collection or create a new theme using the Clone() method.
The Clone method accepts theme properties as a parameter:
- ThemeProperties for built-in classic (Blazing Berry, Blazing Dark, Office White, and Purple) and Bootstrap external themes.
- ThemeFluentProperties for Fluent themes.
Note
Bootstrap themes require theme-specific stylesheets. Once you pass the BootstrapExternal option to the RegisterTheme method, call the Clone method and add an appropriate stylesheet using theme properties.
<head>
@*...*@
@DxResourceManager.RegisterTheme(Themes.OfficeWhite.Clone(properties => {
properties.Name = "Office White Custom";
properties.AddFilePaths("css/OWCustomStyles.css")
}))
</head>