From 1db12af4dc2321a05cc346545bc128cac8f2ce35 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 19 Aug 2016 00:16:55 +0200 Subject: [PATCH] Don't clear TemplatedParent on removal from logical tree. This meant that if a control with a template was removed, when it gets re-added all of the template children's bindings are broken. The logic to clear the TemplatedParent when applying a new template is in TemplatedControl.ApplyTemplate - this is where it should be done. --- src/Avalonia.Controls/Control.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Avalonia.Controls/Control.cs b/src/Avalonia.Controls/Control.cs index 82212a17fe..5cd2ddfc35 100644 --- a/src/Avalonia.Controls/Control.cs +++ b/src/Avalonia.Controls/Control.cs @@ -721,7 +721,6 @@ namespace Avalonia.Controls _isAttachedToLogicalTree = false; _styleDetach.OnNext(this); - this.TemplatedParent = null; OnDetachedFromLogicalTree(e); foreach (var child in LogicalChildren.OfType())