Client Hub Project
This commit is contained in:
27
ClientHub/Pages/RunInfo.razor.cs
Normal file
27
ClientHub/Pages/RunInfo.razor.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace OI.Metrology.ClientHub.Pages;
|
||||
|
||||
public partial class RunInfo
|
||||
{
|
||||
|
||||
[Parameter] public Metrology.Shared.ViewModels.RunInfo? Model { get; set; }
|
||||
|
||||
[Inject] protected IJSRuntime? JSRuntime { get; set; }
|
||||
|
||||
protected override Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
if (JSRuntime is null)
|
||||
throw new NullReferenceException(nameof(JSRuntime));
|
||||
int initialToolTypeID = Model is not null ? Model.ToolTypeID : 0;
|
||||
int initialHeaderId = Model is not null ? Model.HeaderID : 0;
|
||||
string initialHeaderAttachmentId = Model is not null ? Model.HeaderAttachmentID.ToString() : string.Empty;
|
||||
return JSRuntime.InvokeVoidAsync("initRunInfo", initialToolTypeID, initialHeaderId, initialHeaderAttachmentId).AsTask();
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user