|
|
@@ -255,18 +255,9 @@ namespace Avalonia.Controls.Presenters
|
|
|
LogicalChildren.Remove(oldChild);
|
|
|
}
|
|
|
|
|
|
- if (newChild.Parent == null)
|
|
|
+ if (newChild.Parent == null && TemplatedParent == null)
|
|
|
{
|
|
|
- var templatedLogicalParent = TemplatedParent as ILogical;
|
|
|
-
|
|
|
- if (templatedLogicalParent != null)
|
|
|
- {
|
|
|
- ((ISetLogicalParent)newChild).SetParent(templatedLogicalParent);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- LogicalChildren.Add(newChild);
|
|
|
- }
|
|
|
+ LogicalChildren.Add(newChild);
|
|
|
}
|
|
|
|
|
|
VisualChildren.Add(newChild);
|