-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.razor
34 lines (27 loc) · 1.01 KB
/
App.razor
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
31
32
33
34
@inherits LayoutComponentBase
<MudThemeProvider/>
<MudDialogProvider/>
<MudSnackbarProvider/>
<PageTitle>Bitathon</PageTitle>
<MudLayout>
<MudAppBar Color="Color.Primary" Fixed="true">
<MudSpacer/>
<MudButton OnClick='() => SetCurrentTab("BitathonTab")' Color="Color.Primary" Variant="Variant.Filled" DisableElevation="true">Bitathon</MudButton>
<MudButton OnClick='() => SetCurrentTab("ConfigTab")' Color="Color.Primary" Variant="Variant.Filled" DisableElevation="true">Config</MudButton>
<MudSpacer/>
</MudAppBar>
<DynamicComponent Type="CurrentNavigationState" />
</MudLayout>
@code
{
private Type CurrentNavigationState { get; set; } = NavigationStates["ConfigTab"];
private static readonly Dictionary<string, Type> NavigationStates = new()
{
{"BitathonTab", typeof(BitathonTab)},
{"ConfigTab", typeof(ConfigTab)}
};
private void SetCurrentTab(string tabName)
{
CurrentNavigationState = NavigationStates[tabName];
}
}