private void OnPageChanged(PrototypePager sender, PageChangedEventArgs args) { EventHistory.Add($"Page changed from page {args.PreviousPage} to page {args.CurrentPage}"); FirstPageButtonVisibilityTextBlock.Text = TestPager.FirstPageButtonTestHook.Visibility == Visibility.Collapsed ? "Collapsed" : "Visible"; PreviousPageButtonVisibilityTextBlock.Text = TestPager.PreviousPageButtonTestHook.Visibility == Visibility.Collapsed ? "Collapsed" : "Visible"; NextPageButtonVisibilityTextBlock.Text = TestPager.NextPageButtonTestHook.Visibility == Visibility.Collapsed ? "Collapsed" : "Visible"; LastPageButtonVisibilityTextBlock.Text = TestPager.LastPageButtonTestHook.Visibility == Visibility.Collapsed ? "Collapsed" : "Visible"; FirstPageButtonIsEnabledCheckBox.IsChecked = TestPager.FirstPageButtonTestHook.IsEnabled; PreviousPageButtonIsEnabledCheckBox.IsChecked = TestPager.PreviousPageButtonTestHook.IsEnabled; NextPageButtonIsEnabledCheckBox.IsChecked = TestPager.NextPageButtonTestHook.IsEnabled; LastPageButtonIsEnabledCheckBox.IsChecked = TestPager.LastPageButtonTestHook.IsEnabled; }
private void OnPageChanged(PrototypePager sender, PageChangedEventArgs args) { UpdateNumberPanelContentTextBlock(this, null); PreviousPageTextBlock.Text = args.PreviousPage.ToString(); CurrentPageTextBlock.Text = args.CurrentPage.ToString(); FirstPageButtonVisibilityCheckBox.IsChecked = TestPager.FirstPageButtonTestHook.Visibility == Visibility.Visible; PreviousPageButtonVisibilityCheckBox.IsChecked = TestPager.PreviousPageButtonTestHook.Visibility == Visibility.Visible; NextPageButtonVisibilityCheckBox.IsChecked = TestPager.NextPageButtonTestHook.Visibility == Visibility.Visible; LastPageButtonVisibilityCheckBox.IsChecked = TestPager.LastPageButtonTestHook.Visibility == Visibility.Visible; FirstPageButtonIsEnabledCheckBox.IsChecked = TestPager.FirstPageButtonTestHook.IsEnabled; PreviousPageButtonIsEnabledCheckBox.IsChecked = TestPager.PreviousPageButtonTestHook.IsEnabled; NextPageButtonIsEnabledCheckBox.IsChecked = TestPager.NextPageButtonTestHook.IsEnabled; LastPageButtonIsEnabledCheckBox.IsChecked = TestPager.LastPageButtonTestHook.IsEnabled; }
public PagerTemplateSettings(PrototypePager pager) { Pages = new ObservableCollection <int>(Enumerable.Range(1, pager.NumberOfPages)); }