using Microsoft.AspNetCore.Components; using WebWindowComplex.DTO; using WebWindowComplex.Models; namespace WebWindowComplex.Compo { public partial class General { #region Public Properties /// /// Finestra corrente /// [Parameter] public Window CurrWindow { get; set; } = null!; [Parameter] public EventCallback EC_SelColor { get; set; } [Parameter] public EventCallback EC_SelGlass { get; set; } [Parameter] public EventCallback EC_SelWindMat { get; set; } [Parameter] public EventCallback EC_SelProfile { get; set; } [Parameter] public EventCallback EC_ReqClose { get; set; } /// /// Elenco anagrafiche di base /// [Parameter] public BaseListPayload ListPayload { get; set; } = null!; /// /// Elenco Warnings attivi /// [Parameter] public Dictionary ListWarnings { get; set; } = new Dictionary(); #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); } } protected string CurrProfile { get => currProfile; set { currProfile = value; _ = EC_SelProfile.InvokeAsync(value); } } #endregion Protected Properties #region Protected Methods /// /// Calcola CSS warning /// /// /// 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; currProfile = CurrWindow.sProfilePath; } #endregion Protected Methods #region Private Fields private string currColor = ""; private string currGlass = ""; private string currMaterial = ""; private string currProfile = ""; #endregion Private Fields private void ReqClose() { _ = EC_ReqClose.InvokeAsync(true); } } }