Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET: Is there a built in version of PropertyChangedEventArgs that includes the old/new value?

Tags:

.net

Is there a built in version of PropertyChangedEventArgs that includes the old/new value?

like image 859
Jonathan Allen Avatar asked Feb 26 '23 03:02

Jonathan Allen


1 Answers

No. There is no new/old value tracking within the framework's PropertyChangedEventArgs. You could of course sub-class it.

As an exercise though, you might like to implement an adapter that works with INotifyPropertyChanged in conjunction with INotifyPropertyChanging to capture the before/after values and send them on that way.

In WPF, the norm is for dependency properties to raise their change notifications with new/old values though.

like image 173
Reddog Avatar answered Feb 27 '23 16:02

Reddog