Arrange allocates a cell in which the item child will be positioned. If the child is not stretchable there are two possible scenarios:
If the size of the child is smaller than the size of the cell, the child can be aligned within the cell
If the size of the child is bigger than the size of the cell, the child is cut by the cell in accordance with the clipping behavior.
If the child is stretchable, it fills to the maximum the dimension of the cell in the stretching direction. Furthermore, stretching is only applied in case of stretching up. There is no shrinking of element dimensions to make them fit in size less than the requested DesiredSize.
When stretching in a particular direction is turned off for a child element, the parent element will stretch in that direction to accommodate the child.
In case stretching in a particular direction is turned on, the child element will size itself to fill the size allocated to it by the parent, taking into account its margin and padding properties.
In the case that a child is larger than its parent, the parent will only increase in size to accommodate the child in case all of the conditions below are fulfilled:
- Parent’s AutoSize property is set to true.
- Parent’s StretchHorizontally and StretchVertically properties are set to false.
- Child’s DesiredSize is non-zero.
During the layout process, children are placed on top of each other according to their ZIndex properties, or in the case of equivalent ZIndex values, according to the order in which they were added to the Children collection.
The AutoSize property of an element controls whether it will have its size calculated automatically by the layout system. A value of false indicates that the element size will not be changed when calculating the layout.
The desired size returned by the measure stage of the layout process can be ignored by using the BypassLayoutPolicies flag. If this flag is set to true, the size of the child is set to the size specified by the user in the call to the Arrange method.
When the BypassLayoutPolicies flag is set to true, the transformation and constraint implementing logic is bypassed. Any transformation will therefore have to be implemented by the user.
The RadElement FitToSizeMode property controls the area that a child element may paint itself. By default all children are placed in the parent content area and can paint in that area only. FitToSizeMode is taken into account when measuring and arranging elements during layout.
FitToParentContent: The FitToSizeMode for all elements by default is FitToParentContent where the child fills and paints in the parent content area only.
FitToParentPadding: If child element FitToSizeMode is FitToParentPadding, the child fills the padding area of its parent and can paint in both content and padding areas. FillPrimitive and LinePrimitive use this setting.
The BoundingRectangle property stores the bounds of an element relative to its parent element. The transformations applied to the element are stored in its TransformationMatrix property, again relative to its parent element.
The ConrolBoundingRectangle property stores the bounds of an element relative to the root of the element tree, i.e. the control hosting the element tree. The transformations applied to the element relative to the root of the element tree are stored in the TotalTransformationMatrix property.
The DesiredSize property is the size returned by the MeasureOverride method of an element. It indicates how much space is needed by the children of the element to be ordered according to the logic implemented in the MeasureOverride method. The DesiredSize is equal to the BoundingRectangle.Size.