using Microsoft.AspNetCore.Components;
using WebWindowTest.Models;
using static WebWindowTest.Json.WindowConst;
namespace WebWindowTest.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 CurrItem { get; set; } = null!;
///
/// Evento per cambiare tutti i fill
///
[Parameter]
public EventCallback EC_ChangeAllType { get; set; }
///
/// Evento per cambiare solo il fill corrente
///
[Parameter]
public EventCallback EC_ChangeType { get; set; }
///
/// Evento per copiare sash
///
[Parameter]
public EventCallback EC_CopySash { get; set; }
///
/// Evento per aggiungere sash
///
[Parameter]
public EventCallback EC_AddSash { get; set; }
///
/// Evento per tornare nella pagine Tree
///
[Parameter]
public EventCallback EC_ReqClose { get; set; }
///
/// Lista dei Fill
///
[Parameter]
public List FillList { get; set; } = null!;
///
/// Lista delle sash
///
[Parameter]
public List SashList { get; set; } = null!;
///
/// Lista degli Splitted
///
[Parameter]
public List SplittedList { get; set; } = null!;
#endregion Public Properties
#region Protected Methods
///
/// Sollevo evento per cambiare tutti i Fill
///
/// tipo di fill richiesto
///
protected async Task ChangeAllFill(FillTypes reqFillType)
{
await EC_ChangeAllType.InvokeAsync(reqFillType);
}
///
/// Sollevo evento per cambiare solo il Fill corrente
///
/// tipo di fill richiesto
///
protected async Task ChangeOneFill(FillTypes reqFillType)
{
await EC_ChangeType.InvokeAsync(reqFillType);
}
///
/// Sollevo evento per copiare sash
///
///
///
protected async Task CopySash(DataAreaSplit Args)
{
await EC_CopySash.InvokeAsync(Args);
}
///
/// Sollevo evento per aggiungere sash
///
///
///
protected async Task AddSash(DataAreaSplitted Args)
{
await EC_AddSash.InvokeAsync(Args);
}
#endregion Protected Methods
#region Private Methods
///
/// Sollevo evento per tornare alla pagina Tree
///
private void ReqClose()
{
_ = EC_ReqClose.InvokeAsync(true);
}
///
/// 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
}
}