@using SteUp.Shared.Core.Interface.System.Network
@inject INetworkService NetworkService
@inject IDialogService Dialog
@code
{
private bool IsVisible { get; set; } = true;
private bool PlusVisible { get; set; } = true;
private bool SchedaVisible { get; set; }
protected override Task OnInitializedAsync()
{
NavigationManager.LocationChanged += (_, args) =>
{
var location = args.Location.Remove(0, NavigationManager.BaseUri.Length);
var newIsVisible = new List { "ispezioni", "ispezione", "user" }
.Contains(location);
var newPlusVisible = new List { "ispezioni", "ispezione", "user" }
.Contains(location);
if (IsVisible == newIsVisible && PlusVisible == newPlusVisible) return;
IsVisible = newIsVisible;
PlusVisible = newPlusVisible;
StateHasChanged();
};
return Task.CompletedTask;
}
private void NewActivity()
{
_ = ModalHelper.OpenSelectShop(Dialog);
}
private void NewScheda()
{
_ = ModalHelper.OpenFormScheda(Dialog);
}
private void OnOpenMenu()
{
var location = NavigationManager.Uri.Remove(0, NavigationManager.BaseUri.Length);
SchedaVisible = new List { "ispezione" }.Contains(location);
StateHasChanged();
}
}