private void btnNum_Click(object sender, RoutedEventArgs e) { if (PageChanged != null) { Button btn = sender as Button; PageControlItemModel itemModel = btn.CommandParameter as PageControlItemModel; if (itemModel.Page != Page) { Page = itemModel.Page; CalcPageNumList(); PageChangedEventArgs args = new PageChangedEventArgs(itemModel.Page); PageChanged(sender, args); } } }
private void btnNextPage_Click(object sender, RoutedEventArgs e) { int nextPage = Page + 1; if (nextPage > PageCount) { nextPage = PageCount; } if (nextPage != Page) { Page = nextPage; CalcPageNumList(); PageChangedEventArgs args = new PageChangedEventArgs(nextPage); PageChanged(sender, args); } }
private void btnPrePage_Click(object sender, RoutedEventArgs e) { int prePage = Page - 1; if (prePage < 1) { prePage = 1; } if (prePage != Page) { Page = prePage; CalcPageNumList(); PageChangedEventArgs args = new PageChangedEventArgs(prePage); PageChanged(sender, args); } }