using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class EditSplitDimensions
{
#region Public Properties
///
/// Split dimension corrente
///
[Parameter]
public SplitDimension CurrRec { get; set; } = null!;
///
/// Nome dello split dimension corrente
///
[Parameter]
public string Name { get; set; } = null!;
///
/// Indice dello split dimension
///
[Parameter]
public int Index { get; set; } = -1;
[Parameter]
public EventCallback EC_Update { get; set; }
#endregion Public Properties
#region Private Properties
///
/// Metodo per aggiornare la dimensione
///
private double CurrVal
{
get => CurrRec.dDimension;
set
{
if (CurrRec.dDimension != value)
{
CurrRec.dDimension = value;
var args = new DataUpdateSplitDimension()
{
currSplit = CurrRec,
index = Index
};
_ = EC_Update.InvokeAsync(args);
}
}
}
///
/// Metodo per aggiornare il tipo della dimensione
///
private int CurrType
{
get => CurrRec.SelMeasureTypeIndex;
set
{
if (CurrRec.SelMeasureTypeIndex != value)
{
CurrRec.SelMeasureTypeIndex = value;
var args = new DataUpdateSplitDimension()
{
currSplit = CurrRec,
index=Index
};
_ = EC_Update.InvokeAsync(args);
}
}
}
private string SplitDimCss()
{
if (CurrRec.Parent.SelSplitShape.Equals(Json.WindowConst.SplitShapes.GRID))
return "";
else
return "col-md-12 col-lg-6";
}
#endregion Private Properties
}
///
/// Classe per aggiornare split dimension
///
public class DataUpdateSplitDimension
{
public SplitDimension currSplit { get; set; } = null!;
public int index { get; set; } = -1;
}
}