private void NavigationManager_LocationChanged(object sender, Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs e) { NavigationManager.LocationChanged -= NavigationManager_LocationChanged; ParentMenu?.MarkAsRequireRender(); TopMenu.MarkAsRequireRender(); TopMenu.Refresh(); }
protected override void OnInitialized() { base.OnInitialized(); Func <string, bool> matchFunc = TopMenu.Match; if (matchFunc == null) { matchFunc = DefaultMenuMatcher; } if ((!string.IsNullOrWhiteSpace(Options.DefaultActiveIndex) && Options.DefaultActiveIndex == Index) || matchFunc(Route)) { TopMenu.ActivateItem(this); RequireRender = true; ParentMenu?.MarkAsRequireRender(); TopMenu.MarkAsRequireRender(); TopMenu.Refresh(); } }