资源简介
最近用到WPF的表格控件,需要使用分页功能,找了很多例子都不是很满意。有些是模仿SL做的DataPager导航条,使用的时候还要和DataGrid组合使用,不是很方便。最好还是继承DataGrid的分页表格控件。 于是自己动手封装了一个分页表格。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
namespace CustomControlLibrary {
///
/// DataPager.xaml 的交互逻辑
///
public partial class DataPager : UserControl INotifyPropertyChanged {
public DataPager() {
InitializeComponent();
}
#region 依赖属性和事件
public int PageSize {
get { return (int)GetValue(PageSizeProperty); }
set { SetValue(PageSizeProperty value); }
}
// Using a DependencyProperty as the backing store for PageSize. This enables animation styling binding etc...
public static readonly DependencyProperty PageSizeProperty =
DependencyProperty.Register(“PageSize“ typeof(int) typeof(DataPager) new UIPropertymetadata(10));
public int Total {
get { return (int)GetValue(TotalProperty); }
set { SetValue(TotalProperty value); }
}
// Using a DependencyProperty as the backing store for Total. This enables animation styling binding etc...
public static readonly DependencyProperty TotalProperty =
DependencyProperty.Register(“Total“ typeof(int) typeof(DataPager) new UIPropertymetadata(0));
public int PageIndex {
get { return (int)GetValue(PageIndexProperty); }
set { SetValue(PageIndexProperty value); }
}
// Using a DependencyProperty as the backing store for PageIndex. This enables animation styling binding etc...
public static readonly DependencyProperty PageIndexProperty =
DependencyProperty.Register(“PageIndex“ typeof(int) typeof(DataPager) new UIPropertymetadata(1));
public string PageSizeList {
get { return (string)GetValue(PageSizeListProperty); }
set { SetValue(PageSizeListProperty value); }
}
// Using a DependencyProperty as the backing store for PageSizeList. This enables animation styling binding etc...
public static readonly DependencyProperty PageSizeListProperty =
DependencyProperty.Register(“PageSizeList“ typeof(string) typeof(DataPager) new UIPropertymetadata(“51020“ (s e) => {
DataPager dp = s as DataPager;
if (dp.PageSizeItems == null) dp.PageSizeItems = new List();
else dp.PageSizeItems.Clear();
dp.RaisePropertyChanged(“PageSizeItems“);
}));
public IEnumerableject> ItemsSource {
get { return (IEnumerableject>)GetValue(ItemsSourceProperty); }
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 121344 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\bin\Debug\CustomControlLibrary.dll
文件 112128 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\bin\Debug\CustomControlLibrary.pdb
文件 932 2012-05-28 13:20 PagingDataGrid\CustomControlLibrary\Converter\String2ListConverter.cs
文件 5232 2012-05-29 13:32 PagingDataGrid\CustomControlLibrary\CustomControlLibrary.csproj
文件 227 2012-05-28 16:17 PagingDataGrid\CustomControlLibrary\CustomControlLibrary.csproj.user
文件 3630 2012-05-29 10:51 PagingDataGrid\CustomControlLibrary\DataPager.xaml
文件 10533 2012-05-29 11:15 PagingDataGrid\CustomControlLibrary\DataPager.xaml.cs
文件 680 2012-05-29 11:10 PagingDataGrid\CustomControlLibrary\ImageButton.xaml
文件 2585 2012-05-29 08:58 PagingDataGrid\CustomControlLibrary\ImageButton.xaml.cs
文件 40112 2012-05-29 09:09 PagingDataGrid\CustomControlLibrary\ImageButtonChrome.cs
文件 925 2012-05-28 09:02 PagingDataGrid\CustomControlLibrary\Images\pagination_first.gif
文件 13410 2012-05-29 08:39 PagingDataGrid\CustomControlLibrary\Images\pagination_first_gray.gif
文件 923 2012-05-28 09:02 PagingDataGrid\CustomControlLibrary\Images\pagination_last.gif
文件 13410 2012-05-29 08:38 PagingDataGrid\CustomControlLibrary\Images\pagination_last_gray.gif
文件 827 2012-05-28 09:02 PagingDataGrid\CustomControlLibrary\Images\pagination_load.png
文件 1737 2012-05-28 09:02 PagingDataGrid\CustomControlLibrary\Images\pagination_loading.gif
文件 875 2012-05-28 09:02 PagingDataGrid\CustomControlLibrary\Images\pagination_next.gif
文件 13266 2012-05-29 08:39 PagingDataGrid\CustomControlLibrary\Images\pagination_next_gray.gif
文件 879 2012-05-28 09:02 PagingDataGrid\CustomControlLibrary\Images\pagination_prev.gif
文件 13269 2012-05-29 08:39 PagingDataGrid\CustomControlLibrary\Images\pagination_prev_gray.gif
文件 1799 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary.csproj.FileListAbsolute.txt
文件 121344 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary.dll
文件 79563 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary.g.resources
文件 112128 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary.pdb
文件 180 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary.Properties.Resources.resources
文件 283 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary_MarkupCompile.cache
文件 284 2012-05-29 14:57 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary_MarkupCompile.i.cache
文件 182 2012-05-29 14:57 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary_MarkupCompile.i.lref
文件 291 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\CustomControlLibrary_MarkupCompile.lref
文件 3399 2012-05-29 14:58 PagingDataGrid\CustomControlLibrary\obj\Debug\DataPager.baml
............此处省略88个文件信息
相关资源
- 用WPF开发的多人聊天室 语言C#
- winform分页控件
- datagridview控件美化
- WPF控件库HandyControl
- c#DataGridView单元格合并
- WPF
- c# wpf实现的上位机
- VisionPro控件在WPF 应用
- WPF使用MVVM
- winform实现饼状图、柱状图、折线图(
- C#中WPF联合Halcon的一个学习(解决内存
- WPF CEFSHARP 支持 MP4
- WPF贝塞尔曲线
- WPF 简单控件集
- WPF鼠标拖动控件源码
- wpf开发教程
- AduMusic迷你音乐盒WPF源码
- WPF PDF封装(放大、缩小、单页、双页
- C# .NET5.0(net core)基于WPF(XAML)开发
- WPF MVVM 基础入门
- wpf echart
- windorm 加载WPF控件 ,实现dxf文件显示
- WPF Control Development
- wpf Dock window
- WPF 隐蔽查看股票行情工具
- WPF控件库(HandyControl)
- 别踩白块wpf 源码
- WPF贪吃蛇
- WPF Task 多任务
- WPF path动画
评论
共有 条评论