Browse Source

Clear templated child's parent when template detached.

Steven Kirk 7 years ago
parent
commit
95fe6f4cdf
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/Avalonia.Controls/Primitives/TemplatedControl.cs

+ 1 - 0
src/Avalonia.Controls/Primitives/TemplatedControl.cs

@@ -247,6 +247,7 @@ namespace Avalonia.Controls.Primitives
                     foreach (var child in this.GetTemplateChildren())
                     {
                         child.SetValue(TemplatedParentProperty, null);
+                        ((ISetLogicalParent)child).SetParent(null);
                     }
 
                     VisualChildren.Clear();