Example #1
0
        public void FirstPage()
        {
            CurrentPage = 1;
            int maxNum = Total >= MaxSize ? MaxSize : Total;
            var list   = Source?.Take(maxNum);

            PagePagingEvent?.Invoke(list, CurrentPage, TotalPage);
        }
Example #2
0
 private void PagingModel_PagePagingEvent(IEnumerable <ProgramViewModel> arg1, int arg2, int arg3)
 {
     this.ProgramList.Clear();
     arg1.ToList().ForEach(d => ProgramList.Add(d));
     CurrentPage = arg2;
     TotalPage   = arg3;
     PagePagingEvent?.Invoke();
 }
Example #3
0
        public void LinkPage(int pageIndex)
        {
            if (pageIndex > TotalPage)
            {
                pageIndex = TotalPage;
            }
            CurrentPage = pageIndex;
            int maxNum = CurrentPage < TotalPage ? MaxSize : Total - (CurrentPage - 1) * MaxSize;
            var list   = Source.Skip((CurrentPage - 1) * MaxSize).Take(maxNum);

            PagePagingEvent?.Invoke(list, CurrentPage, TotalPage);
        }
Example #4
0
        public bool PrePage()
        {
            if (CurrentPage <= 1)
            {
                return(false);
            }

            var list = Source.Skip((CurrentPage - 1) * MaxSize).Take(MaxSize);

            CurrentPage--;

            PagePagingEvent?.Invoke(list, CurrentPage, TotalPage);
            return(true);
        }
Example #5
0
        public bool NextPage()
        {
            if (CurrentPage >= TotalPage)
            {
                return(false);
            }
            CurrentPage++;
            int maxNum = CurrentPage < TotalPage ? MaxSize : Total - (CurrentPage - 1) * MaxSize;

            var list = Source.Skip((CurrentPage - 1) * MaxSize).Take(maxNum);

            PagePagingEvent?.Invoke(list, CurrentPage, TotalPage);
            return(true);
        }