Files
webwindowconfigurator/WebWindowComplex/Compo/EditOptionText.razor.cs
T
2026-01-19 10:31:08 +01:00

51 lines
1.3 KiB
C#

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