I have a WPF windows app project, it has a window with two ListBox controls, the question is how can I binding one source to these two contorls?
the source is Like :
class student
{
public string name{get;set;}
public int age{get;set;}
}
ObservableCollection<student> m_myGroup;
I want to: ListBox1 binding to m_myGroup if the age > 25
ListBox2 binding to m_myGroup if the age <=25
obviously, both the two ListBox have a
TextBlock Text={binding Path=name}
and I don’t want to use DataTrigger to have the item visibility property Hidden or Show, and I try to use ICollectionView to filter the source, but it will effect the other ListBox!
Does anyone know how to make two filters for each ListBox, and they only binding to one source?
I hope this will help