Browse Source

Handle detached controls in layout pass.

Controls can still be queued for layout after they've been removed from
the visual tree.
pull/278/head
Steven Kirk 11 years ago
parent
commit
b72f08354a
  1. 4
      src/Perspex.Layout/LayoutManager.cs

4
src/Perspex.Layout/LayoutManager.cs

@ -276,12 +276,12 @@ namespace Perspex.Layout
{
var control = item.Control;
while (control.PreviousArrange == null)
while (control != null && control.PreviousArrange == null)
{
control = control.GetVisualParent<ILayoutable>();
}
if (control.GetVisualRoot() == Root)
if (control != null && control.GetVisualRoot() == Root)
{
control.Arrange(control.PreviousArrange.Value, true);
}

Loading…
Cancel
Save