blazor-devexpress-dot-blazor-dot-dxthemebase-1-dot-clone-x28-system-dot-action-0-x29.md
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
public ITheme Clone(
Action<TProps> modifier
)
| Name | Type | Description |
|---|---|---|
| modifier | Action<TProps> |
A delegate method that configures theme properties.
|
| Type | Description |
|---|---|
| ITheme |
The theme.
|
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:
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>
<head>
@*...*@
@DxResourceManager.RegisterTheme(Themes.BootstrapExternal.Clone(properties => {
properties.Name = "Pulse Bootswatch";
properties.AddFilePaths("css/pulse/bootstrap.min.css");
}))
</head>
<head>
@*...*@
@DxResourceManager.RegisterTheme(Themes.Fluent.Clone(properties => {
properties.Name = "Fluent Dark Purple";
properties.Mode = ThemeMode.Dark;
properties.AccentColor = ThemeFluentAccentColor.Purple;
}))
</head>
<head>
@*...*@
@DxResourceManager.RegisterTheme(Themes.Fluent.Clone(properties => {
properties.Name = "Fluent Light Custom";
properties.SetCustomAccentColor("#107c41");
properties.AddFilePaths("css/fluent/FluentCustomStyles.css");
}))
</head>
See Also