Files
webwindowconfigurator/WebWindowComplex/Compo/General.razor.cs
T
2025-10-10 17:05:25 +02:00

111 lines
2.7 KiB
C#

using Microsoft.AspNetCore.Components;
using WebWindowComplex.DTO;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class General
{
#region Public Properties
/// <summary>
/// Finestra corrente
/// </summary>
[Parameter]
public Window CurrWindow { get; set; } = null!;
[Parameter]
public EventCallback<string> EC_SelColor { get; set; }
[Parameter]
public EventCallback<string> EC_SelGlass { get; set; }
[Parameter]
public EventCallback<string> EC_SelWindMat { get; set; }
[Parameter]
public EventCallback<bool> EC_ReqClose { get; set; }
/// <summary>
/// Elenco anagrafiche di base
/// </summary>
[Parameter]
public BaseListPayload ListPayload { get; set; } = null!;
/// <summary>
/// Elenco Warnings attivi
/// </summary>
[Parameter]
public Dictionary<string, string> ListWarnings { get; set; } = new Dictionary<string, string>();
#endregion Public Properties
#region Protected Properties
protected string CurrColor
{
get => currColor;
set
{
currColor = value;
_ = EC_SelColor.InvokeAsync(value);
}
}
protected string CurrGlass
{
get => currGlass;
set
{
currGlass = value;
_ = EC_SelGlass.InvokeAsync(value);
}
}
protected string CurrMaterial
{
get => currMaterial;
set
{
currMaterial = value;
_ = EC_SelWindMat.InvokeAsync(value);
}
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Calcola CSS warning
/// </summary>
/// <param name="fKey"></param>
/// <returns></returns>
protected string cssValid(string fKey)
{
return ListWarnings.ContainsKey(fKey) ? "border border-danger" : "";
}
protected override void OnParametersSet()
{
currColor = CurrWindow.sColorMaterial;
currGlass = CurrWindow.sGlass;
currMaterial = CurrWindow.sMaterial;
}
#endregion Protected Methods
#region Private Fields
private string currColor = "";
private string currGlass = "";
private string currMaterial = "";
#endregion Private Fields
private void ReqClose()
{
_ = EC_ReqClose.InvokeAsync(true);
}
}
}