From a1830b79b500a9bb521fed9a6717f247b366f7b7 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 30 Sep 2022 09:41:40 +0200 Subject: [PATCH] Raise correct inheritance value change. When raising `PropertyChanged` due to setting the inheritance parent, use the closest value in the inheritance tree rather than the furthest. --- src/Avalonia.Base/PropertyStore/ValueStore.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Base/PropertyStore/ValueStore.cs b/src/Avalonia.Base/PropertyStore/ValueStore.cs index 9b80002a33..7fe0213148 100644 --- a/src/Avalonia.Base/PropertyStore/ValueStore.cs +++ b/src/Avalonia.Base/PropertyStore/ValueStore.cs @@ -313,9 +313,14 @@ namespace Avalonia.PropertyStore continue; if (values.TryGetValue(key, out var existing)) - values[key] = existing.WithNewValue(value); + { + if (existing.NewValue is null) + values[key] = existing.WithNewValue(value); + } else + { values.Add(key, new(null, value)); + } } f = f.InheritanceAncestor;