Skip to content

Commit

Permalink
Raise node change even if value hasn't changed.
Browse files Browse the repository at this point in the history
Fixes #16137.
  • Loading branch information
grokys committed Jun 27, 2024
1 parent d6d7719 commit e18b168
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/Avalonia.Base/Data/Core/ExpressionNodes/ExpressionNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,24 +211,8 @@ protected void SetValue(object? valueOrNotification)
protected void SetValue(object? value, Exception? dataValidationError = null)
{
Debug.Assert(value is not BindingNotification);

if (Owner is null)
return;

// We raise a change notification if:
//
// - This is the initial value (_value is null)
// - There is a data validation error
// - There is no data validation error, but the owner has one
// - The new value is different to the old value
if (_value is null ||
dataValidationError is not null ||
(dataValidationError is null && Owner.ErrorType == BindingErrorType.DataValidationError) ||
!Equals(value, _value))
{
_value = value;
Owner.OnNodeValueChanged(Index, value, dataValidationError);
}
_value = value;
Owner?.OnNodeValueChanged(Index, value, dataValidationError);
}

/// <summary>
Expand Down

0 comments on commit e18b168

Please sign in to comment.