I have a class that uses INotifyPropertyChanged and have a List bound to a grid. Every time that object changes it updates the values in the grid. However for historical reasons I want to add that object to a collection/list and bind to a history grid to show all the changes. However every list I have tried seems to subscribe to INotifyPropertyChanged so I only ever get the same amount of items in my history grid.
Is there a list/collection that doesn’t subscribe to INotifyPropertyChanged?
Thanks
If your List is a list of references to a class, you will need to do a “deep clone” of the entire list in order to maintain a historical copy. Otherwise, a copy of the list’s contents will still be references to the “live” objects which are getting changed. Doing this will require code such as:
If the list contains value types (struct), you can just create a new
List<YourType>and copy the original elements over.Also – this has nothing to do with
INotifyPropertyChanged. Lists, themselves, do nothing with thePropertyChangedevent.