Skip to main content
All docs
V25.1
  • 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.v25.1.dll

    NuGet Package: DevExpress.Blazor

    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:

    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>
    
    See Also