using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class EditOptionText
{
#region Public Properties
///
/// Opzione hardware text corrente
///
[Parameter]
public AGBOptionText CurrOpt { get; set; } = null!;
///
/// Livello di accesso (utente base)
///
[CascadingParameter(Name = "User")]
public bool User { get; set; } = false!;
[Parameter]
public EventCallback EC_Update { get; set; }
#endregion Public Properties
#region Private Properties
///
/// Metodo per aggiornare opzione hardware text corrente
///
private string CurrValue
{
get => CurrOpt.sValue;
set
{
if (CurrOpt.sValue != value)
{
if(CurrOpt.sName.Equals("HMan"))
CurrOpt.sValue = value;
else if (CurrOpt.ValueList.FirstOrDefault(x => x == value) != null)
CurrOpt.sValue = CurrOpt.ValueList.FirstOrDefault(x => x == value)!;
_ = EC_Update.InvokeAsync(CurrOpt);
}
}
}
#endregion Private Properties
}
}