Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Border color on MudNavMenu in MudBlazor

$
0
0

Currently I am using MudBlazor to learn the Blazor language. I used MudAppBar and MudNavMenu to create the menu.

<MudThemeProvider /><MudPopoverProvider /><MudDialogProvider /><MudSnackbarProvider /><MudLayout><MudAppBar Color="Color.Primary" Fixed="true"><MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="DrawerToggle" />        @appBarText</MudAppBar><MudDrawer @bind-Open="@_drawerOpen" Anchor="Anchor.Left"><MudDrawerContainer><MudNavMenu Bordered="true"> <MudNavLink Href="" Match="NavLinkMatch.All" >Home</MudNavLink><MudNavLink Href="/counter" >Counter</MudNavLink><MudNavLink Href="fetchdata">FetchData</MudNavLink></MudNavMenu></MudDrawerContainer></MudDrawer><MudMainContent><MudContainer MaxWidth="MaxWidth.ExtraLarge">            @Body</MudContainer></MudMainContent></MudLayout>@code {    bool _drawerOpen = true;    private string appBarText = "Default AppBar Text";    private void UpdateAppBarText(string text)    {        appBarText = text;    }    private void DrawerToggle()    {        _drawerOpen = !_drawerOpen;    }}

enter image description here

Everything was going well until I clicked on "MudNavLink" and updated the "appBarText" and the border of "MudNavMenu" was no longer visible.

@inherits LayoutComponentBase@inject NavigationManager NavManager<MudThemingProvider /><MudPopoverProvider /><MudDialogProvider /><MudSnackbarProvider /><MudLayout><MudAppBar Color="Color.Primary" Fixed="true"><MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="DrawerToggle" />        @appBarText</MudAppBar><MudDrawer @bind-Open="@_drawerOpen" Anchor="Anchor.Left"><MudDrawerContainer><MudNavMenu Bordered="true"><MudNavLink OnClick="@((e) => OnLinkChanged("Home", "/"))" Match="NavLinkMatch.All">Home</MudNavLink><MudNavLink OnClick="@((e) => OnLinkChanged("Counter", "counter"))">Counter</MudNavLink><MudNavLink OnClick="@((e) => OnLinkChanged("FetchData", "fetchdata"))">FetchData</MudNavLink></MudNavMenu></MudDrawerContainer></MudDrawer><MudMainContent><MudContainer MaxWidth="MaxWidth.ExtraLarge">            @Body</MudContainer></MudMainContent></MudLayout>@code {    bool _drawerOpen = true;    private string appBarText = "Default AppBar Text";    private Task OnLinkChanged(string title, string url)    {        appBarText = title;        NavManager.NavigateTo(url);        return Task.CompletedTask;    }    private void DrawerToggle()    {        _drawerOpen = !_drawerOpen;    }}

enter image description here

Can anyone help me with a solution so that the border color of "MudNavMenu" appears again like the first image. Thanks a lot.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>