Table of Contents

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

orientation Orientation

The 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

Proportion

GridLinesX

Gets the vertical grid lines.

public List<int> GridLinesX { get; }

Property Value

List<int>

GridLinesY

Gets the horizontal grid lines.

public List<int> GridLinesY { get; }

Property Value

List<int>

Orientation

Gets the orientation of the stack panel (horizontal or vertical).

public Orientation Orientation { get; }

Property Value

Orientation

Proportions

Gets the collection of proportions for widgets in the stack.

public ObservableCollection<Proportion> Proportions { get; }

Property Value

ObservableCollection<Proportion>

Spacing

Gets or sets the spacing between widgets in pixels.

public int Spacing { get; set; }

Property Value

int

Methods

Arrange(IEnumerable<Widget>, Rectangle)

Arranges the widgets within the specified bounds.

public void Arrange(IEnumerable<Widget> widgets, Rectangle bounds)

Parameters

widgets IEnumerable<Widget>

The widgets to arrange.

bounds Rectangle

The 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

index int

The 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

widgets IEnumerable<Widget>

The widgets to measure.

availableSize Point

The available size for layout.

Returns

Point

The desired size needed to display all widgets.