Class StackPanelLayout
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
Layout engine for arranging widgets in a stack (horizontal or vertical).
public class StackPanelLayout : ILayout
- Inheritance
-
StackPanelLayout
- Implements
- Inherited Members
Constructors
StackPanelLayout(Orientation)
Initializes a new instance of the StackPanelLayout class.
public StackPanelLayout(Orientation orientation)
Parameters
orientationOrientationThe orientation of the stack (horizontal or vertical).
Properties
DefaultProportion
Gets or sets the default proportion for new widgets.
public Proportion DefaultProportion { get; set; }
Property Value
GridLinesX
Gets the vertical grid lines.
public List<int> GridLinesX { get; }
Property Value
GridLinesY
Gets the horizontal grid lines.
public List<int> GridLinesY { get; }
Property Value
Orientation
Gets the orientation of the stack panel (horizontal or vertical).
public Orientation Orientation { get; }
Property Value
Proportions
Gets the collection of proportions for widgets in the stack.
public ObservableCollection<Proportion> Proportions { get; }
Property Value
Spacing
Gets or sets the spacing between widgets in pixels.
public int Spacing { 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 widgets to arrange.
boundsRectangleThe bounds in which to arrange the widgets.
GetCellSize(int)
Gets the size of a cell at the specified index.
public int GetCellSize(int index)
Parameters
indexintThe zero-based index of the cell.
Returns
- int
The size of the cell in pixels.
Measure(IEnumerable<Widget>, Point)
Measures the desired size needed to display all widgets.
public Point Measure(IEnumerable<Widget> widgets, Point availableSize)
Parameters
widgetsIEnumerable<Widget>The widgets to measure.
availableSizePointThe available size for layout.
Returns
- Point
The desired size needed to display all widgets.