I have 3 controls on my page
- ListBox A
- ListBox B
- ComboBox C
ListBox A is databound to a collection of items A
ComboBox C is databound to a collection of items C
ListBox B is databound to a collection of items B
B has a reference to Item A and Item C, the ListBox B should only show the items where Item A is the selected item of ListBox A, and Item C is the selected item of ListBox C
i’ve messed a little with collectionviews as ItemSource on ListBox B, setting a filter, but I can only get it to update the content of ListBox B based on either ListBox A or ComboBox C, not them both at the same time.
Any ideas?
In your view model, give the
CollectionViewa filter predicate, something like this:Bind the list/combo boxes’
SelectedItemtoSelectedCategoryAandSelectedCategoryCproperties. In the setters for those properties, callItems.Refresh().Edit
In your list box, bind both
ItemsSourceandSelectedItem, e.g.In your view model, create a property like this: