Mesmo usando o MainLayout.razon
@inherits LayoutComponentBase
<MudThemeProvider Theme ="@currentTheme"/>
<MudDialogProvider />
<MudSnackbarProvider />
<MudLayout>
<MudAppBar Color="Color.Surface" Fixed="true" Elevation="2">
<MudImage Src="assets/img/logo_branca.png"></MudImage>
</MudAppBar>
<MudDrawer Open="true" ClipMode="DrawerClipMode.Always" Elevation="2">
<NavMenu></NavMenu>
</MudDrawer>
<MudMainContent class="main-content">
@Body
</MudMainContent>
</MudLayout>
@code {
private MudTheme currentTheme = new MudTheme()
{
PaletteLight = EmpresaDigitalPalletDark.CreatePallete,
// PaletteLight = EmpresaDigitalPalletDark.CreatePallete
};
}
implementacao do pallet:
using MudBlazor.Utilities;
using MudBlazor;
namespace EmpresaDigital.Doc.Shared
{
public sealed class EmpresaDigitalPallet : PaletteDark
{
private EmpresaDigitalPallet()
{
Primary = new MudColor("#3C4452");
Secondary = new MudColor("#353C48");
Tertiary = new MudColor("#2F3642");
Info = new MudColor("#AF52BD");
Error = new MudColor("#E35C56");
Warning = new MudColor("#F6B650");
Success = new MudColor("#56A559");
}
public static EmpresaDigitalPallet CreatePallete => new();
}
public sealed class EmpresaDigitalPalletDark : PaletteLight
{
private EmpresaDigitalPalletDark()
{
//Primary = new MudColor("#FFF3FA");
//Secondary = new MudColor("#CC7AC7");
//Tertiary = new MudColor("#661461");
Primary = new MudColor("#9966FF");
Secondary = new MudColor("#F6AD31");
Tertiary = new MudColor("#8AE491");
Info = new MudColor("#AF52BD");
Error = new MudColor("#E35C56");
Warning = new MudColor("#F6B650");
Success = new MudColor("#56A559");
}
public static EmpresaDigitalPalletDark CreatePallete => new();
}
}
tive o mesmo resultado com o menu não aplicando o tema ao menu, notem que nao ha mais um parametro Palette no objeto MudTheme, porem tive o cuidado de extender PaletteLight e PaletteDark, sendo que o
private MudTheme currentTheme = new MudTheme()
{
PaletteLight = EmpresaDigitalPalletDark.CreatePallete,
// PaletteLight = EmpresaDigitalPalletDark.CreatePallete
};
esta recebendo o objeto correto (PaletteDark ou PaletteLight )