Files
gpw_next/GPW.CORE.Smart8.Client/Components/NavBottom.razor.cs
T
2025-03-22 11:05:20 +01:00

103 lines
2.3 KiB
C#

using Microsoft.AspNetCore.Components;
namespace GPW.CORE.Smart8.Client.Components
{
public partial class NavBottom
{
#region Public Properties
[Parameter]
public ConfigDTO CurrConf { get; set; } = null!;
[Parameter]
public int IdxDipendente { get; set; } = 0;
#endregion Public Properties
#region Protected Properties
protected bool isActive { get; set; } = false;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected void goTo(string target)
{
NavMan.NavigateTo($"{CurrConf.BaseUrl}{target}", true);
Console.WriteLine($"NavBottom | NavTo: {target}");
}
protected void goToAbout()
{
goTo("About");
}
protected void goToAdmin()
{
goTo("Admin");
}
protected void goToIndex()
{
goTo("Index");
}
protected void goToMPF()
{
goTo("DayOff");
}
protected void hideMenu()
{
isVisible = false;
hideMenuCSS = "hidden; height: 0%;";
hideButtonCSS = "visible";
}
protected override void OnInitialized()
{
base.OnInitialized();
Console.WriteLine($"NavBottom | Initialized");
}
protected override void OnParametersSet()
{
base.OnParametersSet();
Console.WriteLine($"NavBottom | Params | baseUrl: {CurrConf.BaseUrl} | ver: {CurrConf.Versione} | idxDip: {IdxDipendente}");
}
protected void showMenu()
{
if (IdxDipendente > 0)
{
isVisible = true;
hideMenuCSS = "visible; height: 22%; display:block;";
hideButtonCSS = "hidden";
}
}
protected void slideIn()
{
isActive = false;
}
protected void slideOut()
{
isActive = true;
}
#endregion Protected Methods
#region Private Fields
private string hideButtonCSS = "visible";
private string hideMenuCSS = "hidden";
private bool isVisible = false;
#endregion Private Fields
}
}