Skip to main content
A newer version of this page is available. .

DevExpressWasmMasksServiceCollectionExtensions Class

Contains extension methods to configure IServiceCollection for client-side masks in Blazor Server applications.

Namespace: Microsoft.Extensions.DependencyInjection

Assembly: DevExpress.Blazor.Server.WebAssembly.v22.2.dll

NuGet Package: DevExpress.Blazor.Server.WebAssembly

Declaration

public static class DevExpressWasmMasksServiceCollectionExtensions

Remarks

DevExpress data editors allow you to enable client-side (Web Assembly) masks in Blazor Server applications. In this mode, data editors with masks process input text on the client side to reduce input delays when you have a slow connection.

The mode’s basic principles are listed below:

  • Mask behavior is identical in client-side and server-side modes.
  • DevExpress data editors for Blazor use mono Web Assembly Runtime to implement client-side mask logic.
  • A browser downloads mask-related files only if they are required (for example, when a user opens a page with a masked editor). If a user’s browser uses caching, the files are only downloaded once and then stored in the cache.
  • When a user interacts with the editor, the component sends requests to a mono machine. The machine processes the user action and responds with the result (updated text, caret position, and selection).
  • The editor sends a request to the server only after a user changes the editor value. If a user changes the selection, the editor does not send a request to the server.

To activate this functionality, follow the steps below:

  1. Install the DevExpress.Blazor.Server.WebAssembly NuGet Package.
  2. Register the middleware. Call the UseDevExpressBlazorWasmMasksStaticFiles method in the Program.cs file:

    app.UseDevExpressBlazorWasmMasksStaticFiles();
    
  3. Set up mask-related options. Call the AddDevExpressBlazorWasmMasks method in the Program.cs file:

    builder.Services.AddDevExpressBlazorWasmMasks();
    

Inheritance

Object
DevExpressWasmMasksServiceCollectionExtensions
See Also