I have been working on this issue for a while and I obviously missed something ...
I create, populate and bind an observable collection like this:
Dim _ObservableWEI As New ObservableWEI ... _ObservableWEI.Add(New WEI() With {.WEInum = 1, .WEIvalue = 1}) _ObservableWEI.Add(New WEI() With {.WEInum = 2, .WEIvalue = 0}) _ObservableWEI.Add(New WEI() With {.WEInum = 3, .WEIvalue = 2}) ... lbxAll.ItemsSource = _ObservableWEI
This is normal. Now I need a second list containing a filtered version of the collection. The filter function draws items using WEIvalue = 1.
Dim view As ListCollectionView ... view = CType(CollectionViewSource.GetDefaultView(_ObservableWEI), ListCollectionView) view.Filter = New Predicate(Of Object)(AddressOf ListFilter) ... lbxView.ItemsSource = view
The problem is that the filter affects the contents of both lists. I think I need a specific collection instance to apply the filter too or something, but I'm at a loss!
Thanks for any help.
source share