简体   繁体   中英

How to track if (List<T>)collection is modified?

I have a my custom collection derived from List(.MyItem.)

I want to trace if my collection is modified, how can I do that?

I am able to track Add Remove operations etc...by implement new definition of them but I don't see any method in List that gives me opportunity to track if collection is modified...

Take a look at a new type called ObservableCollection<T> . It has built in notification of changes, and it should be fairly simple to change your base class to this from list as both are very similar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM