using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class EditOptionCombo
{
#region Public Properties
///
/// Opzione hardware combo corrente
///
[Parameter]
public AGBOptionCombo 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 corrente
///
private string CurrValue
{
get => CurrOpt.sValue.sValue;
set
{
if (CurrOpt.sValue.sValue != value && CurrOpt.ValueList.FirstOrDefault(x => x.sValue == value) != null)
{
CurrOpt.sValue = CurrOpt.ValueList.FirstOrDefault(x => x.sValue == value)!;
_ = EC_Update.InvokeAsync(CurrOpt);
}
}
}
#endregion Private Properties
}
}