Browse Source

Don't start values unnecessarily.

refactor/style-priorities
Steven Kirk 4 years ago
parent
commit
18caac12ca
  1. 18
      src/Avalonia.Base/PropertyStore/ValueStore.cs

18
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
{

Loading…
Cancel
Save