26 lines
526 B
C#
26 lines
526 B
C#
|
using MudBlazor;
|
|||
|
|
|||
|
namespace WebUI.Common;
|
|||
|
|
|||
|
public partial class MainLayout
|
|||
|
{
|
|||
|
bool drawerOpen = true;
|
|||
|
|
|||
|
public bool IsDarkMode { get; set; }
|
|||
|
|
|||
|
public MudThemeProvider MudThemeProvider { get; set; } = null!;
|
|||
|
|
|||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|||
|
{
|
|||
|
if (firstRender)
|
|||
|
{
|
|||
|
IsDarkMode = await MudThemeProvider.GetSystemPreference();
|
|||
|
StateHasChanged();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
void DrawerToggle()
|
|||
|
{
|
|||
|
drawerOpen = !drawerOpen;
|
|||
|
}
|
|||
|
}
|