oi-metrology/View/Pages/AwaitingDisposition.razor.cs
2023-02-16 15:17:31 -07:00

45 lines
2.7 KiB
C#

// using IgniteUI.Blazor.Controls;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Logging;
using Microsoft.JSInterop;
using OI.Metrology.View.Models;
namespace OI.Metrology.View;
public partial class AwaitingDisposition
{
// protected IgbIcon? OpenIconRef { get; set; }
// protected IgbIcon? RefreshIconRef { get; set; }
[Inject] protected IJSRuntime? JSRuntime { get; set; }
[Inject] protected HttpClient? HttpClient { get; set; }
[Inject] protected AppSettings? AppSettings { get; set; }
[Inject] protected ILogger<AwaitingDisposition>? Logger { get; set; }
protected override Task OnAfterRenderAsync(bool firstRender)
{
// if (firstRender && OpenIconRef is not null)
// {
// const string svg = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='512' height='512' aria-labelledby='gyjump-down-desc gyjump-down-title'><title id='gyjump-down-title'>Jump Down Icon</title><desc id='gyjump-down-desc'>A picture showing a bent arrow pointing down towards a line.</desc><path d='M21.5 18.5v2h-16v-2h16zm-8-15c1.6 0 3 .5 4.3 1.2l-1.5 1.5c-.8-.4-1.8-.7-2.8-.7-3.3 0-6 2.7-6 6h3l-4 4-4-4h3c0-1.5.4-2.9 1.2-4.2.6-1 1.4-1.8 2.4-2.5 1.2-.8 2.8-1.3 4.4-1.3z'/></svg>";
// _ = OpenIconRef.EnsureReady().ContinueWith(new Action<Task>((e) =>
// OpenIconRef.RegisterIconFromTextAsync("jump-down", svg, "material")));
// }
// if (firstRender && RefreshIconRef is not null)
// {
// const string svg = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='512' height='512' aria-labelledby='lzsystem-update-desc lzsystem-update-title'><title id='lzsystem-update-title'>System Update Icon</title><desc id='lzsystem-update-desc'>A picture depicting a computer screen with a reload symbol in the middle.</desc><path d='M20 2H4a2 2 0 00-2 2v12a2 2 0 002 2h6l-2 4h8l-2-4h6a2 2 0 002-2V4a2 2 0 00-2-2zm-8.194 2.923a5.077 5.077 0 104.724 6.923h.982a6.019 6.019 0 11-.237-4.277l.919-.2-.85 2.631-1.85-2.049.857-.184a5.1 5.1 0 00-4.545-2.844zM14 11.424l-.8.8-2-2V6.715h1.139v3.042z'/></svg>";
// _ = RefreshIconRef.EnsureReady().ContinueWith(new Action<Task>((e) =>
// RefreshIconRef.RegisterIconFromTextAsync("system-update", svg, "material")));
// }
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;
}
}