Skip to end of metadata
Go to start of metadata

Remarks

WrapPanel is used to position child elements in sequential position from left to right, breaking content to the next line when it reaches the edge of its parent container. Content can be oriented horizontally or vertically. WrapPanel is useful for simple flowing user interface (UI) scenarios. It can also be used to apply uniform sizing to all of its child elements.

Example

The following example demonstrates how to create a WrapPanel to display Button controls that wrap when they reach the edge of their container.

XAML

Definition

public class WrapPanel : ISPanel

Summary

The following table summarizes the members exposed in this class.

Public Constructors

WrapPanel Constructor()Initializes a new instance of the WrapPanel class.

Public Properties

ItemHeightGets or sets the height of the layout area for each item that is contained in a WrapPanel.
ItemWidthGets or sets the width of the layout area for each item that is contained in a WrapPanel.
OrientationGets or sets the direction in which child elements are arranged.

Protected Properties

ProductProduct Info.

Fields

ItemHeightPropertyIdentifies the ItemHeight dependency property.
ItemWidthPropertyIdentifies the ItemWidth dependency property.
OrientationPropertyIdentifies the System.Windows.Controls.WrapPanel.Orientation dependency property.

Protected Methods

ArrangeOverride(Size)Provides the behavior for the Arrange pass of Silverlight layout.
MeasureOverride(Size)Provides the behavior for the Measure pass of Silverlight layout.

Public Constructors

public WrapPanel()

Initializes a new instance of the WrapPanel class.

Public Properties

public double ItemHeight { get; set; }

Gets or sets the height of the layout area for each item that is contained in a WrapPanel.

public double ItemWidth { get; set; }

Gets or sets the width of the layout area for each item that is contained in a WrapPanel.

public Orientation Orientation { get; set; }

Gets or sets the direction in which child elements are arranged.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty ItemHeightProperty

Identifies the ItemHeight dependency property.

public static readonly DependencyProperty ItemWidthProperty

Identifies the ItemWidth dependency property.

public static readonly DependencyProperty OrientationProperty

Identifies the System.Windows.Controls.WrapPanel.Orientation dependency property.

Protected Methods

protected Size ArrangeOverride(Size finalSize)

Provides the behavior for the Arrange pass of Silverlight layout.

Parameters

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

Return Types

The actual size used once the element is arranged.

 

protected Size MeasureOverride(Size constraint)

Provides the behavior for the Measure pass of Silverlight layout.

Parameters

constraintThe available size that this object can give to child objects. Infinity can be specified as a value to indicate that the object will size to whatever content is available.

Return Types

The size that this object determines it needs during layout, based on its calculations of child object allotted sizes.
  • No labels