Files
2026-01-28 11:26:54 +01:00

48 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class EditOptionCombo
{
#region Public Properties
/// <summary>
/// Opzione hardware combo corrente
/// </summary>
[Parameter]
public AGBOptionCombo CurrOpt { get; set; } = null!;
/// <summary>
/// Livello di accesso (utente base)
/// </summary>
[CascadingParameter(Name = "User")]
public bool User { get; set; } = false!;
[Parameter]
public EventCallback<AGBOptionCombo> EC_Update { get; set; }
#endregion Public Properties
#region Private Properties
/// <summary>
/// Metodo per aggiornare opzione hardware corrente
/// </summary>
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
}
}