Files
webwindowconfigurator/WebWindowComplex/Compo/CardFill.razor.cs
T
2026-01-19 10:31:08 +01:00

80 lines
2.1 KiB
C#

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