using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; namespace OI.Metrology.ClientHub.Pages; public partial class RunHeaders { [Inject] protected IJSRuntime? JSRuntime { get; set; } protected override Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { if (JSRuntime is null) throw new NullReferenceException(nameof(JSRuntime)); return JSRuntime.InvokeVoidAsync("initRunHeaders").AsTask(); } return Task.CompletedTask; } }