/// <summary> /// refresh UI on DiscovererEvent /// </summary> /// <param name="ev"></param> private Task DiscovererEvent(DiscovererEventApiModel ev) { DiscovererList.Results.Update(ev); _pagedDiscovererList = DiscovererList.GetPaged(int.Parse(Page), CommonHelper.PageLength, DiscovererList.Error); StateHasChanged(); return(Task.CompletedTask); }
/// <summary> /// OnAfterRenderAsync /// </summary> /// <param name="firstRender"></param> protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { DiscovererList = await RegistryHelper.GetDiscovererListAsync(); Page = "1"; _pagedDiscovererList = DiscovererList.GetPaged(int.Parse(Page), CommonHelper.PageLengthSmall, DiscovererList.Error); CommonHelper.Spinner = string.Empty; CommonHelper.CheckErrorOrEmpty(_pagedDiscovererList, ref _tableView, ref _tableEmpty); StateHasChanged(); _discovererEvent = await RegistryServiceEvents.SubscribeDiscovererEventsAsync( ev => InvokeAsync(() => DiscovererEvent(ev))); } }