diff --git a/src/Avalonia.Base/Data/BindingOperations.cs b/src/Avalonia.Base/Data/BindingOperations.cs
index 15de6c4d0d..44b47329ac 100644
--- a/src/Avalonia.Base/Data/BindingOperations.cs
+++ b/src/Avalonia.Base/Data/BindingOperations.cs
@@ -10,6 +10,8 @@ namespace Avalonia.Data
{
public static class BindingOperations
{
+ public static readonly object DoNothing = new object();
+
///
/// Applies an a property on an .
///
diff --git a/src/Avalonia.Base/Data/Core/BindingExpression.cs b/src/Avalonia.Base/Data/Core/BindingExpression.cs
index f1717bde3b..7f8396cdfa 100644
--- a/src/Avalonia.Base/Data/Core/BindingExpression.cs
+++ b/src/Avalonia.Base/Data/Core/BindingExpression.cs
@@ -114,6 +114,11 @@ namespace Avalonia.Data.Core
///
public void OnNext(object value)
{
+ if (value == BindingOperations.DoNothing)
+ {
+ return;
+ }
+
using (_inner.Subscribe(_ => { }))
{
var type = _inner.ResultType;
@@ -126,6 +131,11 @@ namespace Avalonia.Data.Core
ConverterParameter,
CultureInfo.CurrentCulture);
+ if (converted == BindingOperations.DoNothing)
+ {
+ return;
+ }
+
if (converted == AvaloniaProperty.UnsetValue)
{
converted = TypeUtilities.Default(type);
@@ -186,6 +196,11 @@ namespace Avalonia.Data.Core
///
private object ConvertValue(object value)
{
+ if (value == BindingOperations.DoNothing)
+ {
+ return value;
+ }
+
var notification = value as BindingNotification;
if (notification == null)
@@ -196,6 +211,11 @@ namespace Avalonia.Data.Core
ConverterParameter,
CultureInfo.CurrentCulture);
+ if (converted == BindingOperations.DoNothing)
+ {
+ return converted;
+ }
+
notification = converted as BindingNotification;
if (notification?.ErrorType == BindingErrorType.None)
@@ -327,7 +347,18 @@ namespace Avalonia.Data.Core
public void OnNext(object value)
{
+ if (value == BindingOperations.DoNothing)
+ {
+ return;
+ }
+
var converted = _owner.ConvertValue(value);
+
+ if (converted == BindingOperations.DoNothing)
+ {
+ return;
+ }
+
_owner._value = new WeakReference