Class WrapPanelLayout
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
Implements a layout that arranges widgets in rows or columns, wrapping when the edge is reached.
public class WrapPanelLayout : ILayout
- Inheritance
-
WrapPanelLayout
- Implements
- Inherited Members
Properties
Aligned
Gets or sets a value indicating whether widgets in a row/column should be aligned to the row height/column width.
public bool Aligned { get; set; }
Property Value
HorizontalSpacing
Gets or sets the horizontal spacing between widgets.
public int HorizontalSpacing { get; set; }
Property Value
Orientation
Gets or sets the orientation of the layout.
public Orientation Orientation { get; set; }
Property Value
Remarks
The orientation determines what axis of space will be used first; For Horizontal, horizontal space will be used first, wrapping to a new row when necessary. For Vertical, vertical space will be used first, wrapping to a new column when necessary.
PreferredHeight
Gets or sets the preferred height for measurement and arrangement.
public int? PreferredHeight { get; set; }
Property Value
- int?
PreferredWidth
Gets or sets the preferred width for measurement and arrangement.
public int? PreferredWidth { get; set; }
Property Value
- int?
UniformSizing
Gets or sets a value indicating whether all widgets should have the same size, based on the largest widget.
public bool UniformSizing { get; set; }
Property Value
VerticalSpacing
Gets or sets the vertical spacing between widgets.
public int VerticalSpacing { get; set; }
Property Value
Methods
Arrange(IEnumerable<Widget>, Rectangle)
Arranges the widgets within the specified bounds.
public void Arrange(IEnumerable<Widget> widgets, Rectangle bounds)
Parameters
widgetsIEnumerable<Widget>The collection of widgets to arrange.
boundsRectangleThe bounds to arrange the widgets within.
Measure(IEnumerable<Widget>, Point)
Measures the total size required for the widgets given the available size.
public Point Measure(IEnumerable<Widget> widgets, Point availableSize)
Parameters
widgetsIEnumerable<Widget>The collection of widgets to measure.
availableSizePointThe available size for measurement.
Returns
- Point
The required size for the layout.