示例#1
0
 /// <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);
 }
示例#2
0
        /// <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)));
            }
        }