示例#1
0
 private void Next_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentPage < TotalPages)
     {
         CurrentPage += 1;
         OnPageChange?.Invoke(sender, CurrentPage);
     }
 }
示例#2
0
 private void Prev_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentPage > 1)
     {
         CurrentPage -= 1;
         OnPageChange?.Invoke(sender, CurrentPage);
     }
 }
示例#3
0
 public void PageChange(string tabName)
 {
     if (OnPageChange != null)
     {
         OnPageChange.Invoke(this, new ATSCorePageChangeEventArgs {
             Page = tabName
         });
     }
 }
示例#4
0
 private void InitListPager(ListPager listPagerViewModel)
 {
     OnPeopleCountChange                 += (sender, numberOfPeople) => listPagerViewModel.SetNumberOfRows(numberOfPeople);
     listPagerViewModel.OnPageChange     += (sender, page) => OnPageChange?.Invoke(this, page);
     listPagerViewModel.OnPageSizeChange += (sender, pageSize) => OnPageSizeChange?.Invoke(this, pageSize);
     listPagerViewModel.SetNumberOfRows(PersonCount);
     listPagerViewModel.SetPageSize(_pageSize);
     listPagerViewModel.SetCurrentPage(1);
 }
示例#5
0
        private void UIElement_OnKeyUp(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == VirtualKey.Enter)
            {
                if (sender as TextBox == null)
                {
                    return;
                }

                string newValue = new string((sender as TextBox).Text.Where(char.IsDigit).ToArray());
                (sender as TextBox).Text = string.IsNullOrWhiteSpace(newValue) ? "1" : newValue;

                int newPage = string.IsNullOrWhiteSpace(newValue) ? 1 : Convert.ToInt32(newValue);
                CurrentPage = newPage >= 1 && newPage <= TotalPages ? newPage : 1;

                OnPageChange?.Invoke(sender, CurrentPage);
            }
        }
        private void InitPaging()
        {
            var viewPortHeight = viewPortRect.rect.height;

            // How many prefab should be placed on one page.
            pageSize = (int)(viewPortHeight / spacedItemHeight);

            // How many page is needed, counting the last fractional page as a whole.
            pageCount = Mathf.CeilToInt(Items.Count / (float)pageSize);

            // Set the content height, treating the last page as a whole page.
            var contentHeight = pageCount * pageSize * spacedItemHeight;

            contentRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, contentHeight);

            _currentPage = 0;
            OnPageChange?.Invoke(_currentPage, pageCount);
        }
示例#7
0
        private void _OnVisibilityChanged(IElement element, bool isVisible)
        {
            var index = Children.IndexOf(element);

            OnPageChange?.Invoke(element, isVisible, index);
        }
示例#8
0
 public void SetPage(int page)
 {
     Page = page;
     OnPageChange?.Invoke();
 }
        public static event Action <int> OnPageChange; // evenement pas encore vu en classe

        public static void triggerPageChange(int i)
        {
            OnPageChange?.Invoke(i);
        }