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;
}