using GPW.CORE.Smart.Data; using Microsoft.AspNetCore.Components; namespace GPW.CORE.Smart.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 /// /// IdxDipendente corrente /// 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 } }