From 5a117d37c0d1941e0dd1b64ad571d7e7fd55fdfc Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 17 Mar 2023 16:00:07 +0100 Subject: [PATCH] Fix current values being overridden. At the beginning of a re-evaluation pass we mark all effective values as unset in order to signal that we've not yet found a value for them in the value frames. We do this in all cases except when they have a local value: in the case of a local value, the effective value _is_ the value and so value frames should only take effect when they're higher priority than the effective value. However when I added `SetCurrentValue` support, I neglected to change this logic to also take into account current values. Fixes #10655 Fixes #10671 --- src/Avalonia.Base/PropertyStore/EffectiveValue.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Base/PropertyStore/EffectiveValue.cs b/src/Avalonia.Base/PropertyStore/EffectiveValue.cs index 11a4dd7893..7e9f9ae9ba 100644 --- a/src/Avalonia.Base/PropertyStore/EffectiveValue.cs +++ b/src/Avalonia.Base/PropertyStore/EffectiveValue.cs @@ -54,9 +54,9 @@ namespace Avalonia.PropertyStore /// public void BeginReevaluation(bool clearLocalValue = false) { - if (clearLocalValue || Priority != BindingPriority.LocalValue) + if (clearLocalValue || (Priority != BindingPriority.LocalValue && !IsOverridenCurrentValue)) Priority = BindingPriority.Unset; - if (clearLocalValue || BasePriority != BindingPriority.LocalValue) + if (clearLocalValue || (BasePriority != BindingPriority.LocalValue && !IsOverridenCurrentValue)) BasePriority = BindingPriority.Unset; }