Files
mapo-core/MP.INVE/Components/NavMenuTerm.razor.cs
T
zaccaria.majid a57fcc18c2 fix grafici
2022-12-16 10:14:26 +01:00

86 lines
2.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.INVE;
using MP.INVE.Shared;
using MP.INVE.Components;
using MP.INVE.Data;
using MP.Data.DTO;
using Blazored.LocalStorage;
namespace MP.INVE.Components
{
public partial class NavMenuTerm
{
private bool collapseNavMenu = true;
//public List<MP.Data.DatabaseModels.LinkMenu>? ElencoLink { get; set; }
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
{
collapseNavMenu = !collapseNavMenu;
}
protected string cssScan = "";
protected string cssCanc = "";
protected string cssScanBack = "";
protected string cssCancBack = "";
protected string @cssCancScan = "";
protected override async Task OnInitializedAsync()
{
if (isScan)
{
cssCancScan = "bg-info";
cssScanBack = "background-color: rgba(255,255,255,0.7)";
cssScan = "fw-bold text-decoration-underline";
}
else
{
cssCancScan = "bg-danger";
cssCancBack = "background-color: rgba(255,255,255,0.7)";
cssCanc = "fw-bold text-decoration-underline";
}
// recupero elenco JQM
//ElencoLink = await MDService.ElencoLink();
}
protected bool showText { get; set; } = true;
protected void ToggleCompress()
{
showText = !showText;
EC_compressUpdated.InvokeAsync(showText);
}
protected async Task goBack()
{
if (NavigationManager.Uri.Contains(""))
await JSRuntime.InvokeVoidAsync("history.go", -1);
}
protected string hideText { get => showText ? "" : "invisible"; }
[Parameter]
public EventCallback<bool> EC_compressUpdated { get; set; }
[Parameter]
public bool isScan { get; set; } = false;
[Parameter]
public string link { get; set; } = "";
[Inject]
protected ILocalStorageService localStorage { get; set; } = null!;
[Inject]
protected NavigationManager NavigationManager { get; set; } = null!;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
}
}