RemoveAll for ObservableCollections?

前端 未结 7 1387
时光说笑
时光说笑 2020-12-02 21:39

I am looking for Linq way (like RemoveAll method for List) which can remove selected items from my ObservableCollection.

I am too new to create an extension method f

相关标签:
7条回答
  • 2020-12-02 22:36

    There is no way to pass an expression to the ObservableCollection to remove matching items, in the same way that a generic list has. ObservableCollection adds and removes one item at a time.

    You will have to create your own implementation of INotifyCollectionChanged in order to do this, or as you mention create an extension method.

    0 讨论(0)
提交回复
热议问题