In my small WPF project, I have TabControlthree tabs. On each tab there is ListBox. This project tracks the products we need to buy. (No, this is not homework, this is for my wife.) So, I have a list of ShoppingListItems, each of which has the property Nameand Needed: truewhen we need the item, and falseafter we buy it.
So, three tabs - that's all, bought and needed. All of them must point to the same ShoppingListItemCollection(which is inherited from ObservableCollection<ShoppingListItem>). But Bought should only show items where Needed is false, and Needed should only show items where Needed is true. (There are check boxes for items on the All tab.)
It doesn’t seem so difficult, but in a couple of hours I’m not going to figure it out. It seems that CollectionView or CollectionViewSource is what I need, but I can not do anything; I check and uncheck the boxes on the "All" tab, and the items on the other two tabs just sit looking at me.
Any ideas?
source
share