diff --git a/src/Avalonia.Base/PropertyStore/ValueStore.cs b/src/Avalonia.Base/PropertyStore/ValueStore.cs index b5db37ca20..2b194ffbe6 100644 --- a/src/Avalonia.Base/PropertyStore/ValueStore.cs +++ b/src/Avalonia.Base/PropertyStore/ValueStore.cs @@ -823,20 +823,20 @@ namespace Avalonia.PropertyStore for (var j = 0; j < count; ++j) { var entry = frame.GetEntry(j); + var property = entry.Property; + EffectiveValue? effectiveValue = null; - if (!entry.HasValue) + // Skip if we already have a value/base value for this property. + if (_effectiveValues?.TryGetValue(property, out effectiveValue) == true && + effectiveValue.BasePriority < BindingPriority.Unset) continue; - var property = entry.Property; + if (!entry.HasValue) + continue; - if (_effectiveValues is not null && - _effectiveValues.TryGetValue(property, out var effectiveValue)) + if (effectiveValue is not null) { - if (effectiveValue.Priority == BindingPriority.Unset || - effectiveValue.BasePriority == BindingPriority.Unset) - { - effectiveValue.SetAndRaise(this, entry, priority); - } + effectiveValue.SetAndRaise(this, entry, priority); } else {