Skip to main content

DevExpressServiceCollectionExtensions.AddDevExpressBlazor(IServiceCollection, Action<GlobalOptions>) Method

Adds internal DevExpress Blazor services to the IServiceCollection collection and sets up DevExpress Blazor components’ global options.

Namespace: Microsoft.Extensions.DependencyInjection

Assembly: DevExpress.Blazor.v22.1.dll

Declaration

public static void AddDevExpressBlazor(
    this IServiceCollection services,
    Action<GlobalOptions> configure = null
)

Parameters

Name Type Description
services IServiceCollection

The application’s service collection.

Optional Parameters

Name Type Default Description
configure Action<GlobalOptions> null

A delegate method that configures global options for DevExpress Blazor components.

Remarks

Call this method in the Program.cs file to register internal DevExpress Blazor services. Pass global option values to this method to set options that apply to all DevExpress Blazor components.

The example below sets the BootstrapVersion global option to v5:

using DevExpress.Blazor;

/* ... */
builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5);
See Also