1
0
mirror of synced 2024-12-02 17:57:18 +01:00
GC-local-server-rewrite/WebUI/Common/MainLayout.razor.cs
2023-02-21 22:45:51 +08:00

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;
}
}