In This Article

MultiColumnPanel Class

Provides an implementation of a Panel that can render child elements in multiple columns, collapsing columns down as available space decreases.

public class MultiColumnPanel : Panel
Inheritance:
object Visual UIElement FrameworkElement Panel object

Constructors

MultiColumnPanel()

Initializes an instance of the class.

public MultiColumnPanel()

Properties

CanRemoveEmptyColumns

Indicates whether columns without any items can be removed, with remaining columns filling in, thereby maximizing use of available width.

public bool CanRemoveEmptyColumns { get; set; }

Property Value

bool:

true if columns without any items can be removed; otherwise, false. The default value is false.

Remarks

When using multiple MultiColumnPanel instances in a stack where columns should always be aligned, leave this property its default of false. Alternatively when wanting to maximize use of available width, set this property to true.

ColumnMargin

The margin width between columns.

public double ColumnMargin { get; set; }

Property Value

double:

The default value is 50.0.

ColumnMinWidth

The minimum column width needed for another column to be added.

public double ColumnMinWidth { get; set; }

Property Value

double:

The default value is 300.0.

MaxColumnCount

The maximum column count.

public int MaxColumnCount { get; set; }

Property Value

int:

The default value is 2.

Methods

ArrangeOverride(Size)

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

Fields

CanRemoveEmptyColumnsProperty

Defines the CanRemoveEmptyColumns property.

public static readonly DependencyProperty CanRemoveEmptyColumnsProperty

ColumnMarginProperty

Defines the ColumnMargin property.

public static readonly DependencyProperty ColumnMarginProperty

ColumnMinWidthProperty

Defines the ColumnMinWidth property.

public static readonly DependencyProperty ColumnMinWidthProperty

MaxColumnCountProperty

Defines the MaxColumnCount property.

public static readonly DependencyProperty MaxColumnCountProperty

Extension Methods