Browse Source

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.
Steven Kirk 9 years ago
parent
commit
1db12af4dc
1 changed files with 0 additions and 1 deletions
  1. 0 1
      src/Avalonia.Controls/Control.cs

+ 0 - 1
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<Control>())