views:

312

answers:

1

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?

+3  A: 

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.

Mike Two
I actually like this interface better. Thanks Mike!
Brian MacKay