protected override void OnMeasure(LayoutMeasureSpec widthMeasureSpec, LayoutMeasureSpec heightMeasureSpec)
{
Log.Info("NUI", "OnMeasure\n");
- LayoutLength childWidth = new LayoutLength( 0 );
- LayoutLength childHeight = new LayoutLength( 0 );
+ LayoutLength childWidth = new LayoutLength(0);
+ LayoutLength childHeight = new LayoutLength(0);
LayoutLength measuredWidth = childWidth;
LayoutLength measuredHeight = childHeight;
for (uint i = 0; i < ChildCount; ++i)
{
- var childLayout = GetChildAt( i );
+ var childLayout = GetChildAt(i);
- if( childLayout )
+ if (childLayout)
{
MeasureChild(childLayout, widthMeasureSpec, heightMeasureSpec);
childWidth = childLayout.MeasuredWidth;
protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
Log.Info("NUI", "OnLayout\n");
- for( uint i = 0; i < ChildCount; ++i )
+
+ for (uint i = 0; i < ChildCount; ++i)
{
- var childLayout = GetChildAt( i );
- if( childLayout )
+ var childLayout = GetChildAt(i);
+ if (childLayout)
{
View childOwner = childLayout.GetOwner();
// Use position if explicitly set to child otherwise will be top left.
- var childLeft = new LayoutLength( childOwner.Position2D.X );
- var childTop = new LayoutLength( childOwner.Position2D.Y );
+ var childLeft = new LayoutLength(childOwner.Position2D.X);
+ var childTop = new LayoutLength(childOwner.Position2D.Y);
View owner = GetOwner();
- if ( owner )
+ if (owner)
{
// Margin and Padding only supported when child anchor point is TOP_LEFT.
- if ( owner.PivotPoint == PivotPoint.TopLeft || ( owner.PositionUsesPivotPoint == false ) )
+ if (owner.PivotPoint == PivotPoint.TopLeft || (owner.PositionUsesPivotPoint == false))
{
- childLeft = childLeft + owner.Padding.Start + childOwner.Margin.Start;
- childTop = childTop + owner.Padding.Top + childOwner.Margin.Top;
+ childLeft = childLeft + owner.Padding.Start + childOwner.Margin.Start;
+ childTop = childTop + owner.Padding.Top + childOwner.Margin.Top;
}
}
- childLayout.Layout( childLeft, childTop, childLeft + childLayout.MeasuredWidth, childTop + childLayout.MeasuredHeight );
+ childLayout.Layout(childLeft, childTop, childLeft + childLayout.MeasuredWidth, childTop + childLayout.MeasuredHeight);
}
}
}
/// </summary>
/// <param name="newSize">The new size of the layout.</param>
/// <param name="oldSize">The old size of the layout.</param>
- protected override void OnSizeChanged(LayoutSize newSize, LayoutSize oldSize)
+ protected virtual void OnSizeChanged(LayoutSize newSize, LayoutSize oldSize)
{
}