Add AObservableObject.OnPropertyChanged() overrides
Currently AObservableObject.OnPropertyChanged(ref T target, T value)
checks for inequality before setting the value and raising the event. In hindsight, that was not the best choice for the default behavior. The method should set the target to the value and raise the event without any comparisons.
To address this poor design, I suggest the following:
- Deprecate the two
OnPropertyChanged()
methods. - Implement
RaisePropertyChanged()
methods using the new desired default behavior. - Implement
RaiseIfPropertyChanged()
method that takes anEqualityComparer<T>
. - Implement
RaiseIfPropertyChanged()
override to wrap the previous default behavior.