@inherits LayoutComponentBase @implements IDisposable @inject NavigationManager NavigationManager @inject NotificationService NotificationService @inject IWebHostEnvironment WebHostEnvironment @if (WebHostEnvironment.IsDevelopment()) { } else { } @Body Произошла непредвиденная ошибка Перезагрузить 🗙 @code { bool sidebarExpanded = true; string? currentUrl; protected override void OnInitialized() { currentUrl = NavigationManager.ToBaseRelativePath(NavigationManager.Uri); NavigationManager.LocationChanged += OnLocationChanged; } public void Dispose() { NavigationManager.LocationChanged -= OnLocationChanged; } private void OnLocationChanged(object? sender, LocationChangedEventArgs e) { currentUrl = NavigationManager.ToBaseRelativePath(e.Location); NotificationService.Messages.Clear(); StateHasChanged(); } }