我有一个DataPager
,我正在进行自定义分页。我想根据返回的总ItemCount
的{{1}}设置DataPager
的{{1}}属性。但我发现COUNT
属于rows
属性。我怎么能ItemCount
呢?任何出路?
包含read-only
属性
set
接口
IPagedCollectionView
答案 0 :(得分:0)
因为计算(总)计数的逻辑应该封装在类
中public int ItemCount
{
get { return YOURCALCULATIONMETHOD(); }
}
答案 1 :(得分:0)
有一种方法,但我不确定你想这样做。
我在Silverlight中不擅长但理论上你需要创建继承自IPagedCollectionView
public class MyPagedCollectionView : IPagedCollectionView
{
public int ItemCount
{
get { return this.GetItemCount(); }
}
public int TotalItemCount
{
get { return this.GetTotalItemCount(); }
}
private int GetTotalItemCount()
{
// Implement the method
}
private int GetItemCount()
{
// Implement the method
}
}