55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Threading.Tasks;
|
|
using WebWindowTest.Models;
|
|
using static WebWindowTest.Json.WindowConst;
|
|
|
|
namespace WebWindowTest.Compo
|
|
{
|
|
public partial class AreaHwOption
|
|
{
|
|
/// <summary>
|
|
/// Sash corrente rispetto alla lista Sash
|
|
/// </summary>
|
|
[CascadingParameter(Name = "CurrSashGroup")]
|
|
public Sash CurrSashGroup { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Evento per chiamare la prima volta la lista delle opzioni
|
|
/// </summary>
|
|
[Parameter]
|
|
public EventCallback<int> EC_FirstHwOptionList { get; set; }
|
|
|
|
[CascadingParameter(Name = "IsLoading")]
|
|
public List<string> IsLoading { get; set; } = new List<string>();
|
|
|
|
private bool hwOptCollapsed { get; set; } = true;
|
|
|
|
protected override void OnAfterRender(bool firstRender)
|
|
{
|
|
if (firstRender)
|
|
{
|
|
hwOptCollapsed = true;
|
|
}
|
|
}
|
|
|
|
private async Task changeCollapsed()
|
|
{
|
|
hwOptCollapsed = !hwOptCollapsed;
|
|
if (CurrSashGroup.HwOptionList.Count == 0)
|
|
{
|
|
await EC_FirstHwOptionList.InvokeAsync();
|
|
}
|
|
}
|
|
|
|
private string hwIcon
|
|
{
|
|
get => hwOptCollapsed ? "fa-solid fa-chevron-down" : "fa-solid fa-chevron-up";
|
|
}
|
|
|
|
private bool IsLoadingHwOpt
|
|
{
|
|
get => IsLoading != null && IsLoading.Count > 0 && IsLoading.Contains("LoadHwOpt");
|
|
}
|
|
}
|
|
} |