Rely on routing for window content
This commit is contained in:
parent
f05e125809
commit
0917437dec
5 changed files with 44 additions and 23 deletions
|
|
@ -1,16 +1,24 @@
|
|||
@using Photino.Blazor.CustomWindow.Components
|
||||
@inject LocalizationService LocalizationService
|
||||
@inject LocalizationService LocalizationService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<CustomWindow HeaderHeight="37">
|
||||
<WindowContent>
|
||||
<div style="padding-top: 37px">
|
||||
<ErrorHandler Title="@LocalizationService.GetString("LauncherCrashed")">
|
||||
<Body>
|
||||
<Chat/>
|
||||
<Router AppAssembly="@typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Windows.ChatWindow)" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<PageTitle>@LocalizationService.GetString("NotFound")</PageTitle>
|
||||
<LayoutView Layout="@typeof(Windows.ChatWindow)">
|
||||
<p role="alert">@LocalizationService.GetString("NotFoundMessage")</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
|
||||
<AntContainer/>
|
||||
</Body>
|
||||
</ErrorHandler>
|
||||
</div>
|
||||
</WindowContent>
|
||||
</CustomWindow>
|
||||
@code {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var currentUri = new Uri(NavigationManager.Uri);
|
||||
|
||||
if (currentUri.LocalPath == "/")
|
||||
NavigationManager.NavigateTo("/Chat", true);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +1,24 @@
|
|||
@using LANCommander.Launcher.Services
|
||||
@inject LocalizationService LocalizationService
|
||||
@inject LocalizationService LocalizationService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<Router AppAssembly="@typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(UI.MainLayout)" />
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Windows.MainWindow)" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<PageTitle>@LocalizationService.GetString("NotFound")</PageTitle>
|
||||
<LayoutView Layout="@typeof(UI.MainLayout)">
|
||||
<LayoutView Layout="@typeof(Windows.MainWindow)">
|
||||
<p role="alert">@LocalizationService.GetString("NotFoundMessage")</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
</Router>
|
||||
|
||||
@code {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var currentUri = new Uri(NavigationManager.Uri);
|
||||
|
||||
if (currentUri.LocalPath == "/")
|
||||
NavigationManager.NavigateTo("/Library", true);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
@page "/"
|
||||
@page "/{id:guid}"
|
||||
@page "/Library"
|
||||
@page "/Library/{id:guid}"
|
||||
@using LANCommander.Launcher.Data.Models
|
||||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.Launcher.UI.Library.Components
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
async Task SelectLibraryItem(Guid id)
|
||||
{
|
||||
NavigationManager.NavigateTo($"/{id}");
|
||||
NavigationManager.NavigateTo($"/Library/{id}");
|
||||
}
|
||||
|
||||
async Task OnLibraryItemSelected(Models.ListItem item)
|
||||
|
|
|
|||
3
LANCommander.Launcher/UI/Pages/Chat/Index.razor
Normal file
3
LANCommander.Launcher/UI/Pages/Chat/Index.razor
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
@page "/Chat"
|
||||
|
||||
<Chat />
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
@page "/Settings"
|
||||
@using System.Globalization
|
||||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.SDK.Providers
|
||||
@layout AuthenticatedLayout
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject UpdateService UpdateService
|
||||
@inject SDK.Client Client
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue