/// <summary>
/// Internals the property change.
/// </summary>
/// <param name="objectInstance">The object instance.</param>
/// <param name="newValue">The new value.</param>
/// <param name="currentValue">The current value.</param>
/// <param name="message">The message.</param>
private void InternalPropertyChange(BindableBase objectInstance, TProperty newValue, ref TProperty currentValue, string message)
{
var changing = (this.EqualityComparer != null) ?
!this.EqualityComparer(newValue, currentValue) :
!Object.Equals(newValue, currentValue);
if (changing)
{
var oldvalue = currentValue;
currentValue = newValue;
ValueChangedEventArgs <TProperty> arg = null;
Func <PropertyChangedEventArgs> lzf =
() =>
{
arg = arg ?? new ValueChangedEventArgs <TProperty>(message, oldvalue, newValue);
return(arg);
};
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(message));
objectInstance.RaisePropertyChanged(lzf);
ValueChanged?.Invoke(this, lzf() as ValueChangedEventArgs <TProperty>);
ValueChangedWithNameOnly?.Invoke(this, new PropertyChangedEventArgs(message));
ValueChangedWithNothing?.Invoke(this, EventArgs.Empty);
}
}