搜索和展示都没什么可说的吧,很基础的东西~其实在listbox里点了按钮进行翻页也不难啦。。但还是写在这里记录一下吧,希望对小小白起到帮助哦
代码里的注释还算清楚,语句也没有复杂的地方,所以就直接贴代码吧
/// /// customDataPage.xaml 的交互逻辑 /// public partial class customDataPage : UserControl, INotifyPropertyChanged { private DataTable _dataGridItemsSource = new DataTable(); /// /// DataGrid的数据源 /// public DataTable DataGridItemsSource { get { return _dataGridItemsSource; } set { _dataGridItemsSource = value; ChangeDataGridItemsSource(); } } public static readonly DependencyProperty NumbersPerPageProperty = DependencyProperty.Register("NumbersPerPage", typeof(int), typeof(customDataPage), new FrameworkPropertyMetadata(10, null)); /// /// 每页显示的最大条数 /// public int NumbersPerPage { get { return (int)this.GetValue(NumbersPerPageProperty); } set { this.SetValue(NumbersPerPageProperty, value); } } public static readonly RoutedEvent SelectionChangedEvent = EventManager.RegisterRoutedEvent("SelectionChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler