I cannot get these elements to function at 100% without setting a global rendermode for the entire app. The problems I see so far are:
- Toggling the drawer open/closed does not work in MainLayout so they must be moved to another component that specifies a rendermode. When doing that, you have to leave the MudLayout component in MainLayout which breaks the display when you open the drawer (the content doesn't shrink properly when it's open and AppBar stays the same size and overlays on top of the drawer).
- Anything requiring MudPopoverProvider (MudMenu, MudPopover) cannot be included in the AppBar, they simply don't work no matter where you inject the providers.
If anyone has a working example of this it would be extremely helpful but I feel like these are bugs because I can't think of any combination of all of the above I've not yet tried.
EDIT:I finally figured out my menu / provider issues by moving them all into the client project and forcing web assembly whenever they're used, but the layout issue persists when MudLayout and the AppBar / Drawer are not on the same page. If I wrap the elements in MainNav.razor in a MudLayout the drawer / appbar function just fine but the rest of the layout breaks. Here are simplified but still non-functional snippets:
MainLayout.razor:
<MudThemingProvider Theme="_myTheme" /><MudLayout><MainNav @rendermode="InteractiveWebAssembly" /><MudMainContent><Breadcrumb @rendermode="InteractiveWebAssembly" /> @Body</MudMainContent></MudLayout>MainNav.razor:
<MudAppBar Elevation="1" Dense="true"><MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@DrawerToggle" /><MudElement><MudText Typo="Typo.h5" Class="app-title">@Title</MudText></MudElement></MudAppBar><MudDrawer @bind-Open="@_drawerOpen" ClipMode="DrawerClipMode.Never" Breakpoint="Breakpoint.Md" PreserveOpenState="true" Elevation="1" Variant="@DrawerVariant.Mini"><MudNavMenu><MudNavLink Href="/" Match="NavLinkMatch.All" Icon="@Icons.Material.Outlined.Dashboard">Dashboard</MudNavLink></MudNavMenu></MudDrawer>