private async void getDS() { clearControl(); lstNV = await GetPagedListAsync(); btnPrevious.IsEnabled = lstNV.HasPreviousPage; btnNext.IsEnabled = lstNV.HasNextPage; lblPageNumber.Content = string.Format("Trang {0}/{1}", pageNumber, lstNV.PageCount); dg.ItemsSource = xl.getDSNhanVien(lstNV).ToList(); dg.SelectedValuePath = "MaNhanVien"; }
public async Task <IPagedList <NhanVien> > GetPagedListAsync(int pagenumber = 1, int pageSize = 5) { return(await Task.Factory.StartNew(() => { return xlNV.getDSNhanVien().ToPagedList(pageNumber, pageSize); })); }