Skip to content

Commit

Permalink
Using AuthorizeRouteView
Browse files Browse the repository at this point in the history
JByfordRew committed Apr 4, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 556756f commit d110ec2
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<LayoutView Layout="@typeof(MainLayout)">
<TransitionableRoutePrimary RouteData="@routeData" ForgetStateOnTransition="true">
<MyAuthorizeRouteView DefaultLayout="@typeof(MyViewLayout)" />
</TransitionableRoutePrimary>
<TransitionableRouteSecondary RouteData="@routeData" ForgetStateOnTransition="true">
<MyAuthorizeRouteView DefaultLayout="@typeof(MyViewLayout)" />
</TransitionableRouteSecondary>
</LayoutView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@if (Transition?.RouteData != null)
{
<CascadingValue Value="Transition">
<AuthorizeRouteView RouteData="@Transition.RouteData" DefaultLayout="@DefaultLayout"></AuthorizeRouteView>
</CascadingValue>
}

@code {
[CascadingParameter]
public Transition Transition { get; set; }

[Parameter]
public Type DefaultLayout { get; set; }
}

0 comments on commit d110ec2

Please sign in to comment.