@using Wabbajack.App.Blazor.Pages @using Wabbajack.App.Blazor.Shared @using Wabbajack.App.Blazor.State @namespace Wabbajack.App.Blazor.Components @* TODO: [Low] Clean this up a bit. *@
@code { [Inject] NavigationManager _navigationManager { get; set; } [Inject] GlobalState GlobalState { get; set; } [CascadingParameter] protected MainLayout _mainLayout { get; set; } private void Navigate(string page) { _navigationManager.NavigateTo(page); } protected override void OnInitialized() { _navigationManager.LocationChanged += (o, args) => StateHasChanged(); GlobalState.OnNavigationStateChange += StateHasChanged; } private string CurrentPage(string page) { string relativePath = _navigationManager.ToBaseRelativePath(_navigationManager.Uri).ToLower(); return page.ToLower() == relativePath ? "active" : ""; } }