-
Notifications
You must be signed in to change notification settings - Fork 854
Expand file tree
/
Copy pathRoutes.razor
More file actions
30 lines (26 loc) · 1.05 KB
/
Routes.razor
File metadata and controls
30 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@using Aspire.Dashboard.Components.Resize
@inject IStringLocalizer<Resources.Routes> Loc
<BrowserDimensionWatcher @bind-ViewportInformation="@_viewportInformation" />
@if (_viewportInformation is null)
{
// prevent render until we've determined the browser viewport so that we don't have to re-render
// if we guess wrong
return;
}
<CascadingValue Value="@_viewportInformation">
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<!-- AuthorizeRouteView protects pages from being accessed when authorization is required -->
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
</Found>
<NotFound>
<PageTitle>@Loc[nameof(Resources.Routes.NotFoundPageTitle)]</PageTitle>
<LayoutView Layout="@typeof(Layout.MainLayout)">
<Aspire.Dashboard.Components.Pages.NotFound />
</LayoutView>
</NotFound>
</Router>
</CascadingValue>
@code {
private ViewportInformation? _viewportInformation;
}