From dd1709732324739db36ce30fbc7e8d45c091b172 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Wed, 15 Feb 2023 10:05:17 +0100 Subject: [PATCH] Added failing test for #10255 . --- .../AvaloniaObjectTests_Binding.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Binding.cs b/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Binding.cs index baaed5104d..b6036bba8f 100644 --- a/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Binding.cs +++ b/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Binding.cs @@ -167,6 +167,22 @@ namespace Avalonia.Base.UnitTests Assert.Equal("foo", target.GetValue(property)); } + [Fact] + public void Completing_Animation_Binding_Reverts_To_Set_LocalValue_With_Style_Value() + { + var target = new Class1(); + var source = new Subject>(); + var property = Class1.FooProperty; + + target.SetValue(property, "style", BindingPriority.Style); + target.SetValue(property, "foo"); + target.Bind(property, source, BindingPriority.Animation); + source.OnNext("bar"); + source.OnCompleted(); + + Assert.Equal("foo", target.GetValue(property)); + } + [Fact] public void Completing_LocalValue_Binding_Raises_PropertyChanged() {