0

I set up an ItemsControl with the items source set to a List. I then filter this ItemsControl using code like the following:

CollectionViewSource.GetDefaultView(myList).Filter = filterFunction;

This worked as expected. However, I have since changed the items source to a ReadOnlyCollection. The items still show up in my ItemsControl, but the filter is no longer applied.

Changing the Items source back to a List restores the filter functionality. Is this expected behavior? How can I use a filter with a ReadOnlyCollection as the items source?

BPC
  • 3
  • 3
  • 1
    That's weird, because the the `CollectionViewSource` never actually changes the underlying view. Shouldn't matter that it's read-only. – McGarnagle May 03 '17 at 21:01
  • Maybe replace ReadOnlyCollection with ReadOnlyObservableCollection – Wouter May 03 '17 at 22:16

0 Answers0