Browse Source

Don't perform layout on removed controls.

Ensure the control is still a member of the visual tree before
attempting to measure/arrange it.
pull/58/head
Steven Kirk 12 years ago
parent
commit
3ef01d954d
  1. 10
      Perspex.Layout/LayoutManager.cs

10
Perspex.Layout/LayoutManager.cs

@ -183,7 +183,10 @@ namespace Perspex.Layout
parent = parent.GetVisualParent<ILayoutable>();
}
parent.Measure(parent.PreviousMeasure.Value, true);
if (parent.GetVisualRoot() == this.Root)
{
parent.Measure(parent.PreviousMeasure.Value, true);
}
}
}
}
@ -229,7 +232,10 @@ namespace Perspex.Layout
control = control.GetVisualParent<ILayoutable>();
}
control.Arrange(control.PreviousArrange.Value, true);
if (control.GetVisualRoot() == this.Root)
{
control.Arrange(control.PreviousArrange.Value, true);
}
if (this.toMeasure.Count > 0)
{

Loading…
Cancel
Save