private void LoadMoreSortedItems(uint count, int baseIndex) { NotifyTaskCompletion.Create <IEnumerable <T> >( _dataProvider.GetSortedCollectionPagedAsync(_sortDictionary, baseIndex, _defaultPage), (task, ev) => { if (task is INotifyTaskCompletion <IEnumerable <T> > taskResult) { if (taskResult.IsSuccessfullyCompleted) { OnNewPage?.Invoke(taskResult.Task.Result); } else { _dialogService.ShowErrorMessage("Cannot load sorted items"); } } }); }
/// <summary> /// Recursive parsing of link tree /// </summary> /// <param name="parrentPage"></param> /// <returns></returns> protected async Task FillChildPages(HtmlPageInfo parrentPage) { List <string> links = GetUniqueLinks(parrentPage); _tempLinks.AddRange(links); foreach (string link in links) { HtmlPageInfo childPage = await GetPageInfo(link); if (childPage == null) { continue; } Pages.Add(childPage); OnNewPage?.Invoke(this, childPage); await FillChildPages(childPage); } }