utilize _Imports.razor to simplify module declarations

This commit is contained in:
Shaun Walker
2019-09-24 17:26:14 -04:00
parent 747f55262b
commit 3af2ca0168
65 changed files with 92 additions and 365 deletions

View File

@ -0,0 +1,31 @@
@namespace Oqtane.Themes.Controls
@inherits ThemeControlBase
@inject NavigationManager NavigationManager
<AuthorizeView>
<Authorizing>
<text>...</text>
</Authorizing>
<Authorized>
<button type="button" class="btn btn-primary" @onclick="UpdateProfile">@context.User.Identity.Name</button>
</Authorized>
<NotAuthorized>
<button type="button" class="btn btn-primary" @onclick="RegisterUser">Register</button>
</NotAuthorized>
</AuthorizeView>
@code {
private void RegisterUser()
{
NavigationManager.NavigateTo(NavigateUrl("register"));
}
private void UpdateProfile()
{
NavigationManager.NavigateTo(NavigateUrl("profile"));
}
}