// Parent not a View so assume it's a Layer which is the size of the window.
private void MeasureAndLayout(View root, float parentWidth, float parentHeight)
{
- if (root.Layout != null)
+ var layout = root.Layout;
+ if (layout != null)
{
// Determine measure specification for root.
// The root layout policy could be an exact size, be match parent or wrap children.
var widthMode = GetMode(root.WidthSpecification);
var heightMode = GetMode(root.HeightSpecification);
- if (root.Layout.NeedsLayout(widthSize, heightSize, widthMode, heightMode))
+ if (layout.NeedsLayout(widthSize, heightSize, widthMode, heightMode))
{
var widthSpec = CreateMeasureSpecification(widthSize, widthMode);
var heightSpec = CreateMeasureSpecification(heightSize, heightMode);
// Start at root which was just measured.
PerformLayout(root, new LayoutLength(positionX),
new LayoutLength(positionY),
- new LayoutLength(positionX) + root.Layout.MeasuredWidth.Size,
- new LayoutLength(positionY) + root.Layout.MeasuredHeight.Size);
+ new LayoutLength(positionX) + layout.MeasuredWidth.Size,
+ new LayoutLength(positionY) + layout.MeasuredHeight.Size);
}
}