feat(maui): implement unified Serilog logging infrastructure and Blazor/JS interop bridge
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using NexusReader.UI.Shared
|
||||
@using NexusReader.Maui.Infrastructure.Logging
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject BlazorLoggingBridge LoggingBridge
|
||||
|
||||
<Router AppAssembly="@typeof(NexusReader.UI.Shared._Imports).Assembly">
|
||||
<Found Context="routeData">
|
||||
@@ -16,3 +19,21 @@
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
|
||||
@code {
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dotNetRef = DotNetObjectReference.Create(LoggingBridge);
|
||||
await JSRuntime.InvokeVoidAsync("NexusLogging.initializeBridge", dotNetRef);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"[SerilogBridge] Failed to initialize Blazor/JS Bridge: {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user