using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex.Compo { public partial class CardFill { #region Public Properties /// /// Indice del fill corrente rispetto alla lista fill /// [Parameter] public int CurrIndex { get; set; } = 0; /// /// Fill corrente rispetto alla lista fill /// [Parameter] public Fill CurrFill { get; set; } = null!; /// /// Livello di accesso (utente base) /// [Parameter] public bool User { get; set; } = false!; /// /// Evento per cambiare tutti i fill /// [Parameter] public EventCallback EC_UpdateFill { get; set; } /// /// Evento per tornare nella pagine Tree /// [Parameter] public EventCallback EC_ReqClose { get; set; } #endregion Public Properties #region Protected Methods /// /// Metodo per cambiare solo il Fill corrente /// /// Tipo di fill richiesto /// protected Task ChangeOneFill(FillTypes reqFillType) { CurrFill.SelFillType = reqFillType; return EC_UpdateFill.InvokeAsync(CurrFill); } #endregion Protected Methods #region Private Methods /// /// Metodo per tornare alla pagina Tree /// private void ReqClose() { _ = EC_ReqClose.InvokeAsync(true); } /// /// Calcola bottone selezionato per il Fill /// /// private string buttonFillCss(FillTypes reqFillTypes) { return (CurrFill.SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm"; } #endregion Private Methods } }