|
|
@ -237,7 +237,7 @@ namespace Avalonia.Controls.Presenters |
|
|
// template.
|
|
|
// template.
|
|
|
LogicalChildren.Remove(oldChild); |
|
|
LogicalChildren.Remove(oldChild); |
|
|
} |
|
|
} |
|
|
else |
|
|
else if (TemplatedParent != null) |
|
|
{ |
|
|
{ |
|
|
// If we're in a ContentControl's template then invoke ChildChanging to let
|
|
|
// If we're in a ContentControl's template then invoke ChildChanging to let
|
|
|
// ContentControlMixin handle removing the logical child.
|
|
|
// ContentControlMixin handle removing the logical child.
|
|
|
@ -248,6 +248,10 @@ namespace Avalonia.Controls.Presenters |
|
|
newChild, |
|
|
newChild, |
|
|
BindingPriority.LocalValue)); |
|
|
BindingPriority.LocalValue)); |
|
|
} |
|
|
} |
|
|
|
|
|
else if (oldChild != null) |
|
|
|
|
|
{ |
|
|
|
|
|
((ISetInheritanceParent)oldChild).SetParent(oldChild.Parent); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Set the DataContext if the data isn't a control.
|
|
|
// Set the DataContext if the data isn't a control.
|
|
|
@ -433,6 +437,7 @@ namespace Avalonia.Controls.Presenters |
|
|
{ |
|
|
{ |
|
|
VisualChildren.Remove(Child); |
|
|
VisualChildren.Remove(Child); |
|
|
LogicalChildren.Remove(Child); |
|
|
LogicalChildren.Remove(Child); |
|
|
|
|
|
((ISetInheritanceParent)Child).SetParent(Child.Parent); |
|
|
Child = null; |
|
|
Child = null; |
|
|
_dataTemplate = null; |
|
|
_dataTemplate = null; |
|
|
} |
|
|
} |
|
|
|