65 lines
1.5 KiB
C#
65 lines
1.5 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace MP.MONO.UI.Shared
|
|
{
|
|
public partial class NavMenu
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_compressUpdated { get; set; }
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
protected string hideText { get => showText ? "" : "invisible"; }
|
|
protected bool showText { get; set; } = true;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected void ToggleCompress()
|
|
{
|
|
showText = !showText;
|
|
EC_compressUpdated.InvokeAsync(showText);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private bool collapseNavMenu = true;
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
private string AppName
|
|
{
|
|
get => Configuration.GetValue<string>("Application:Name");
|
|
}
|
|
|
|
private string AppShortName
|
|
{
|
|
get => Configuration.GetValue<string>("Application:ShortName");
|
|
}
|
|
|
|
[Inject]
|
|
private IConfiguration Configuration { get; set; } = null!;
|
|
|
|
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void ToggleNavMenu()
|
|
{
|
|
collapseNavMenu = !collapseNavMenu;
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |