Browse Source

Revert "Fix ContentPresenter logical parent logic."

This reverts commit 9b68067a15.
dans-repro-without-1284
Steven Kirk 8 years ago
committed by Dan Walmsley
parent
commit
f41ded2b7f
  1. 13
      src/Avalonia.Controls/Presenters/ContentPresenter.cs

13
src/Avalonia.Controls/Presenters/ContentPresenter.cs

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

Loading…
Cancel
Save