Lets say I have this class:
public class MyData
{
public bool IsActive{get;set;}
public String Data1 {get;set;}
public String Data2 {get;set;}
}
and an
ObservableCollection<MyData> data = new ObservableCollection<MyData>;
ListBox.ItemsSource = data;
Adding items to the ObservableCollectionworks as expected; however, I want to make sure that my listbox only displays items where IsActive
is set to 'true' -- I can't use a Linq query to set the ItemsSource because then its not an ObservableCollection, its IEnumerable and does not do any update notifications to the listbox.