Browse Source

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
pull/10695/head
Steven Kirk 4 years ago
parent
commit
5a117d37c0
  1. 4
      src/Avalonia.Base/PropertyStore/EffectiveValue.cs

4
src/Avalonia.Base/PropertyStore/EffectiveValue.cs

@ -54,9 +54,9 @@ namespace Avalonia.PropertyStore
/// </remarks>
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;
}

Loading…
Cancel
Save