public void Initialize(IContent[] articles) { var path = new UserFolderPath(); var fileSystemNode = new FileSystemNode(path.FullPath); _collectionView.Add(new CollectionItem(new TabView(fileSystemNode) { IsDeletable = false, OnSelected = OnTabSelected }, new HorizontalSeparatorView()), animated: false); var collectionItems = new List <CollectionItem>(); for (int i = 0; i < articles.Length; i++) { var article = articles[i]; collectionItems.Add(new CollectionItem(new TabView(article, i) { OnSelected = OnTabSelected, IsDefaultTab = false }, new HorizontalSeparatorView())); } _collectionView.AddRangeWithoutAnimation(collectionItems.ToArray()); }
/// <summary>Internals the load more items asynchronous.</summary> /// <param name="count">The count.</param> /// <returns></returns> async Task <LoadMoreItemsResult> InternalLoadMoreItemsAsync(uint count) { var rval = await _loadMore(CollectionView, (int)count); _hasNoMore = !rval.HaveMore; foreach (var x in rval.NewItems) { CollectionView.Add(x); } return(new LoadMoreItemsResult { Count = count }); }
private async void LoadNextPage() { await new AsyncForEach <SearchResult>(_searchQuery.Results.Skip(_page * 20).Take(20)) .Execute( body: async result => { await Task.Run(() => result.Findings.Take(5).ToArray()); _searchResultsCollection.Add(GetCollectionItem(result)); }, onProgress: () => _progress.Text = _searchQuery.Results.Completion.ProgressPercentage); _page++; }