Agent code and restructuring
This commit is contained in:
+39
-2
@@ -1,5 +1,42 @@
|
||||
<MudThemeProvider IsDarkMode="true"/>
|
||||
@inject IGlossaryDialogService GlossaryDialogService
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<MudThemeProvider IsDarkMode="true"/>
|
||||
<MudDialogProvider/>
|
||||
<MudSnackbarProvider/>
|
||||
|
||||
<HomePage/>
|
||||
<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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user