ItemsControl.filter

ItemsControl.Items.Filter = new Predicate<object>(SetFilter);

private bool SetFilter(object de)

{

m_FilterCount++;

Notification noti = de as Notification;

if (noti == null)

{

return false;

}

if (m_FilterCount > Notes.Count)

{

return false;

}

//The count is less than max show records ,all records are visible

 

if (Notes.Count <= MaxShowRecords)

{

return true;

}

if (Notes.IndexOf(noti) >= Notes.Count - MaxShowRecords)

{

return true;

}

return false;

}

posted on 2009-01-04 21:16  oyl  阅读(274)  评论(0编辑  收藏  举报

导航