开发者

Generic Collection - CollectionBase, IBindingList and Firing Events on Item Changes/Edits

开发者 https://www.devze.com 2023-03-31 05:15 出处:网络
I\'ve implemented a GenericCollection using IBindingList, and it works great and fires events for when items are added or removed. It doesn\'t fire events when items are changed/edited as expected. Is

I've implemented a GenericCollection using IBindingList, and it works great and fires events for when items are added or removed. It doesn't fire events when items are changed/edited as expected. Is there a simple way to implement logic to catch a change or edit without having to implement INotifyPropertyChanged within each class that uses this collection?

I might be looking for something not possible, but I'm basically looking to mimic functionality of a DataTable without having to code in the INotifyPropertyChanged for each class that uses the collection and I want to have my grid receive the edits/changes.

Thanks,

Mar开发者_运维问答k


You should use the BindingList<T> class, which already does all that.


Use System.Collections.ObjectModel.ObservableCollection class.

0

精彩评论

暂无评论...
验证码 换一张
取 消