Advertisement
Iv555

Untitled

Feb 25th, 2023
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public class PagingViewModel
  2. {
  3. public int CurrentPageNumber { get; set; }
  4.  
  5. public bool HasPreviousPage => this.CurrentPageNumber > 1;
  6.  
  7. public int PreviousPageNumber => this.CurrentPageNumber - 1;
  8.  
  9. public bool HasNextPage => this.CurrentPageNumber < this.PagesCount;
  10.  
  11. public int NextPageNumber => this.CurrentPageNumber + 1;
  12.  
  13. public int PagesCount => (int)Math.Ceiling((double)this.AllItemsCount / this.ItemsPerPage);
  14.  
  15. public int ItemsPerPage { get; set; }
  16.  
  17. public int AllItemsCount { get; set; }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement