From 6421d422cbf884a265e00a92c84a56a00c9cae62 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 26 Oct 2017 01:01:07 +0200 Subject: [PATCH] Fix data context change notification. Don't notify a non-inheritance child that the data context has begun changing, because it won't receive the accompanying end change notification. Fixes #1245. --- src/Avalonia.Controls/Control.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Control.cs b/src/Avalonia.Controls/Control.cs index a7aafbf6e8..d4777b2f8a 100644 --- a/src/Avalonia.Controls/Control.cs +++ b/src/Avalonia.Controls/Control.cs @@ -774,7 +774,9 @@ namespace Avalonia.Controls foreach (var child in control.LogicalChildren) { - if (child is Control c && !c.IsSet(DataContextProperty)) + if (child is Control c && + c.InheritanceParent == control && + !c.IsSet(DataContextProperty)) { DataContextNotifying(c, notifying); }