Back to Devexpress

DxResourceManager.LoadDxResources(IJSRuntime) Method

blazor-devexpress-dot-blazor-dot-dxresourcemanager-dot-loaddxresources-x28-microsoft-dot-jsinterop-dot-ijsruntime-x29.md

latest1.8 KB
Original Source

DxResourceManager.LoadDxResources(IJSRuntime) Method

Forces the Resource Manager to load client resources.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.Resources.v25.2.dll

NuGet Package : DevExpress.Blazor.Resources

Declaration

csharp
public static Task<IJSRuntime> LoadDxResources(
    this IJSRuntime jSRuntime
)

Parameters

NameTypeDescription
jSRuntimeIJSRuntime

A JavaScript runtime instance.

|

Returns

TypeDescription
Task<IJSRuntime>

A structure that stores an awaitable result of an asynchronous operation.

|

Remarks

If you register a custom script, call the LoadDxResources method before you access the script’s API members for the first time:

csharp
// ...
@code {
    [Inject] IJSRuntime js;
    protected override async Task OnAfterRenderAsync(bool firstRender) {
        if(firstRender) {
            await js.LoadDxResources();
            await js.InvokeAsync("a-method-from-a-custom-script");
        }
        await base.OnAfterRenderAsync(firstRender);
    }
}

Refer to the following topic for additional information: DxResourceManager.

See Also

DxResourceManager Class

DxResourceManager Members

DevExpress.Blazor Namespace