I needed a generic collection or list that can fire an event when an item is added or removed.
I discovered that BindingList(of T) has events for this and wired up a quick proof of concept that worked fine.
Of course, this doesn't feel like the most educated choice; BindingList is overkill for what I'm doing. Are there any simpler collection/list objects that do this?
I could roll my own of course.
Bonus Points: While we're at it, are you aware of any really comprehensive resources that go over all the .Net collection types in detail?
ObservableCollection(of T) implements INotifyCollectionChanged. It will notify you when items are added or removed. That isn't the same interface as IRaiseItemChangedEvents which is implemented by BindingList(of T). It should work for you though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With