Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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...

like image 427
Ashish Ashu Avatar asked Jan 01 '26 18:01

Ashish Ashu


1 Answers

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.

like image 85
Jerry Bullard Avatar answered Jan 03 '26 12:01

Jerry Bullard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!