Files
gpw_next/GPW.CORE.Smart8/Components/Pages/Admin.razor.cs
T

52 lines
1.2 KiB
C#

using GPW.CORE.Smart8.Data;
using Microsoft.AspNetCore.Components;
namespace GPW.CORE.Smart8.Components.Pages
{
public partial class Admin : IDisposable
{
#region Public Methods
public void Dispose()
{
MService.EA_DipUpdated -= MService_EA_DipUpdated;
GC.Collect();
}
#endregion Public Methods
#region Protected Methods
protected override void OnInitialized()
{
MService.EA_DipUpdated += MService_EA_DipUpdated;
idxDipendente = MService.IdxDipendente;
}
#endregion Protected Methods
#region Private Properties
/// <summary>
/// IdxDipendente corrente
/// </summary>
private int idxDipendente { get; set; } = 0;
[Inject]
private MessageService MService { get; set; } = null!;
#endregion Private Properties
#region Private Methods
private async void MService_EA_DipUpdated()
{
await Task.Delay(1);
idxDipendente = MService.IdxDipendente;
await Task.Delay(1);
await InvokeAsync(StateHasChanged);
}
#endregion Private Methods
}
}