0

What is the easiest way to find an item in CollectionViewSource? I can't seem to find a linq friendly property. I would like to do something like MyCollectionViewSource.View.Where(x=>x...)

Cheers,
Berryl

Berryl
  • 12,471
  • 22
  • 98
  • 182

1 Answers1

0

You have to cast src.Source to whatever collection you bound it to. For example, if your CollectionViewSource's Source is an IEnumerable<Int32> you would do this:

(MyCollectionViewSource.Source as IEnumerable<Int32>).Where(s => s < 2);
sidney.andrews
  • 5,146
  • 3
  • 23
  • 29