Ejemplo n.º 1
0
 private void UpdatePageInfo()
 {
     if (_dataSource == null)
     {
         return;
     }
     _filteredDataSource = _dataSource;
     if (ItemFilter != null)
     {
         _filteredDataSource = _filteredDataSource.Where(x => ItemFilter.Filter(x, _filter));
     }
     _pageCount        = (int)Math.Ceiling(_filteredDataSource.Count() / (double)_pageSize);
     _currentPageIndex = Math.Min(Math.Max(0, _pageCount - 1), _currentPageIndex);
     OnPageInfoUpdated();
 }
Ejemplo n.º 2
0
 public async Task OnGet()
 {
     if (!string.IsNullOrEmpty(this.filterTypeValue) && !string.IsNullOrEmpty(searchString))
     {
         this.items = Array.FindAll(await service.GetItemsAsync(false, false), i => ItemFilter.Filter(i, this.filterTypeValue, this.searchString));
     }
     else
     {
         this.items = await service.GetItemsAsync(false, false);
     }
 }