-
+ @MenuItem.DisplayName
+
+ }
+
@foreach (var childMenuItem in MenuItem.Items)
{
-
+
}
diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavMenu.razor.cs b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavMenu.razor.cs
index fb117369eb..5b9c07ad44 100644
--- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavMenu.razor.cs
+++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavMenu.razor.cs
@@ -1,7 +1,9 @@
using System;
+using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
+using Volo.Abp.AspNetCore.Components.Web.Security;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
@@ -12,24 +14,24 @@ public partial class NavMenu : IDisposable
protected IMenuManager MenuManager { get; set; }
[Inject]
- protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
+ protected ApplicationConfigurationChangedService ApplicationConfigurationChangedService { get; set; }
protected ApplicationMenu Menu { get; set; }
- protected override async Task OnInitializedAsync()
+ protected async override Task OnInitializedAsync()
{
Menu = await MenuManager.GetMainMenuAsync();
- AuthenticationStateProvider.AuthenticationStateChanged += AuthenticationStateProviderOnAuthenticationStateChanged;
+ ApplicationConfigurationChangedService.Changed += ApplicationConfigurationChanged;
}
- public void Dispose()
+ private async void ApplicationConfigurationChanged()
{
- AuthenticationStateProvider.AuthenticationStateChanged -= AuthenticationStateProviderOnAuthenticationStateChanged;
+ Menu = await MenuManager.GetMainMenuAsync();
+ await InvokeAsync(StateHasChanged);
}
- private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task