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.
pull/691/head
Steven Kirk 10 years ago
parent
commit
1db12af4dc
  1. 1
      src/Avalonia.Controls/Control.cs

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>())

Loading…
Cancel
Save