using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; namespace Blazor.App.Web { /// /// /// public sealed partial class App { /// /// /// [Inject] private IJSRuntime JSRuntime { get; set; } /// /// /// /// protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); if (firstRender && OperatingSystem.IsBrowser()) { await JSRuntime.InvokeVoidAsync("$.loading"); } } } }