From f79b58cc55e2ab172d1b417aab99edfa01e81509 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 14 Feb 2020 23:13:32 +0100 Subject: [PATCH 1/2] Added failing test possibly for #3466. Not sure if this is the cause of #3466, but it's definitely wrong. --- .../AvaloniaObjectTests_SetValue.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_SetValue.cs b/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_SetValue.cs index 98305cc110..4b477287e8 100644 --- a/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_SetValue.cs +++ b/tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_SetValue.cs @@ -240,6 +240,17 @@ namespace Avalonia.Base.UnitTests Assert.Equal("two", target.GetValue(Class1.FooProperty)); } + [Fact] + public void SetValue_Animation_Overrides_LocalValue() + { + Class1 target = new Class1(); + + target.SetValue(Class1.FooProperty, "one", BindingPriority.LocalValue); + Assert.Equal("one", target.GetValue(Class1.FooProperty)); + target.SetValue(Class1.FooProperty, "two", BindingPriority.Animation); + Assert.Equal("two", target.GetValue(Class1.FooProperty)); + } + [Fact] public void Setting_UnsetValue_Reverts_To_Default_Value() { From aec9c6e5e2efb6e98c5fa7e132f7c754aa568ad2 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 14 Feb 2020 23:14:40 +0100 Subject: [PATCH 2/2] Make animation value override local value. This line was missing. Might be the cause of #3466. --- src/Avalonia.Base/ValueStore.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Avalonia.Base/ValueStore.cs b/src/Avalonia.Base/ValueStore.cs index 22cded565a..e9118af9f1 100644 --- a/src/Avalonia.Base/ValueStore.cs +++ b/src/Avalonia.Base/ValueStore.cs @@ -232,6 +232,7 @@ namespace Avalonia else { var priorityValue = new PriorityValue(_owner, property, this, l); + priorityValue.SetValue(value, priority); _values.SetValue(property, priorityValue); } }