2

I have a class with observable collection property and I edit this property with PropertyGrid. When I remove some items from it and press OK button my collection starting to fire CollectionChanged events, but it doesn't fire event with Remove Action. Firstly it fires event with Reset action and then it fires events with Add action of remain items.

How can I get when collection fires last CollectionChanged event?

How can I get which items was removed?

yolo sora
  • 434
  • 5
  • 17
  • If I understand you correctly you want to avoid an event for each Add. In that case you can check [this thread](http://stackoverflow.com/questions/9570800/why-does-observablecollection-not-support-bulk-changes) and study the RangeObservableCollection - it worked very well for me! – default Apr 25 '17 at 11:41

1 Answers1

0

Well, I did a pretty weird solution, but it worked for me, mb it gonna help someone later. It has some obviously evil sides, but for now it is still better than nothing.

Everytime when CollectionChanged fired I start my local timer with, for example, 500ms interval, if timer is elapsed - last collection changed event already triggered.

Also I have a local copy of unique IDs of items in my observable collection, so after timer elapsing I can check which items was removed from collection, so i can clean data which was binded on it.

yolo sora
  • 434
  • 5
  • 17