Files
IGP-Fan-Reference/Device/MainRazor.razor
T
2026-06-04 12:07:14 -04:00

43 lines
1.1 KiB
Plaintext

@inject IGlossaryDialogService GlossaryDialogService
@inject IJSRuntime JsRuntime
<MudThemeProvider IsDarkMode="true"/>
<MudDialogProvider/>
<MudSnackbarProvider/>
<Router AppAssembly="@typeof(HomePage).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
<EntityDialogPortal/>
<GlossaryDialogPortal/>
<ToastPortal/>
<SearchPortal/>
<ConfirmationDialogPortal/>
@code {
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JsRuntime.InvokeVoidAsync("glossaryInterop.init", DotNetObjectReference.Create(this));
}
}
[JSInvokable]
public void OpenGlossaryTerm(string termId)
{
GlossaryDialogService.AddDialog(termId);
StateHasChanged();
}
}