oi-metrology/ClientHub/Pages/AwaitingDisposition.razor.cs
2023-01-19 16:45:16 -07:00

25 lines
757 B
C#

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