Vertical
}
- private Orientation _linearOrientation = Orientation.Vertical;
+ private Orientation _GridOrientation = Orientation.Vertical;
const int AUTO_FIT = -1;
private int _columns = 1;
private int _rows = 1;
/// </summary>
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
- public Orientation LinearOrientation
+ public Orientation GridOrientation
{
get
{
- return _linearOrientation;
+ return _GridOrientation;
}
set
{
- _linearOrientation = value;
+ _GridOrientation = value;
RequestLayout();
}
}
}
}
- if (_linearOrientation == Orientation.Horizontal)
- CalculateHorizontalSize(gridWidthMode, gridHeightMode, widthSize, heightSize);
+ if (_GridOrientation == Orientation.Horizontal)
+ widthSize = CalculateHorizontalSize(gridWidthMode, gridHeightMode, widthSize, heightSize);
else
- CalculateVerticalSize(gridWidthMode, gridHeightMode, widthSize, heightSize);
+ heightSize = CalculateVerticalSize(gridWidthMode, gridHeightMode, widthSize, heightSize);
} // Children exists
+ else
+ {
+ if (_GridOrientation == Orientation.Horizontal)
+ {
+ widthSize = (gridWidthMode == MeasureSpecification.ModeType.Unspecified)?0:widthSize;
+ }
+ else
+ {
+ heightSize = (gridHeightMode == MeasureSpecification.ModeType.Unspecified)?0:heightSize;
+ }
+ }
LayoutLength widthLength = new LayoutLength(widthSize + Padding.Start + Padding.End);
LayoutLength heightLenght = new LayoutLength(heightSize + Padding.Top + Padding.Bottom);
SetMeasuredDimensions(widthMeasuredSize, heightMeasuredSize);
}
- private void CalculateHorizontalSize(MeasureSpecification.ModeType gridWidthMode, MeasureSpecification.ModeType gridHeightMode, int widthSize, int heightSize)
+ private int CalculateHorizontalSize(MeasureSpecification.ModeType gridWidthMode, MeasureSpecification.ModeType gridHeightMode, int widthSize, int heightSize)
{
int availableContentWidth;
int availableContentHeight;
DetermineNumberOfRows(availableContentHeight);
_locations.CalculateLocationsRow(_rows, availableContentWidth, availableContentHeight, childCount);
+
+ return availableContentWidth;
}
- private void CalculateVerticalSize(MeasureSpecification.ModeType gridWidthMode, MeasureSpecification.ModeType gridHeightMode, int widthSize, int heightSize)
+ private int CalculateVerticalSize(MeasureSpecification.ModeType gridWidthMode, MeasureSpecification.ModeType gridHeightMode, int widthSize, int heightSize)
{
int availableContentWidth;
int availableContentHeight;
// Locations define the start, end,top and bottom of each cell.
_locations.CalculateLocations(_columns, availableContentWidth, availableContentHeight, childCount);
+
+ return availableContentHeight;
}
/// <summary>