using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex.Compo { public partial class CardFill { #region Public Properties [Parameter] public int CurrIndex { get; set; } = 0; [Parameter] public Fill CurrItem { get; set; } = null!; [Parameter] public EventCallback EC_ChangeAllType { get; set; } [Parameter] public EventCallback EC_ChangeType { get; set; } [Parameter] public EventCallback EC_CopySash { get; set; } [Parameter] public EventCallback EC_ReqClose { get; set; } [Parameter] public List FillList { get; set; } = null!; [Parameter] public List SashList { get; set; } = null!; [Parameter] public List SplittedList { get; set; } = null!; #endregion Public Properties #region Protected Methods protected async Task ChangeAllFill(FillTypes reqFillType) { await EC_ChangeAllType.InvokeAsync(reqFillType); } protected async Task ChangeOneFill(FillTypes reqFillType) { await EC_ChangeType.InvokeAsync(reqFillType); } protected async Task CopySash(Data Args) { await EC_CopySash.InvokeAsync(Args); } #endregion Protected Methods #region Private Methods /// /// Calcola bottone selezionato per il Fill /// /// private string buttonFillCss(FillTypes reqFillTypes) { return (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm"; } #endregion Private Methods private void ReqClose() { _ = EC_ReqClose.InvokeAsync(true); } } }