GreedyWrapPanel GreedyWrapPanel GreedyWrapPanel GreedyWrapPanel Class


Microsoft internal use only. This panel is very similar to a WrapPanel, but instead of wrapping when a boundary is reached, it wraps once it has enough space.For Orientation=Vertical, this means that it will use as many columns as it can, given enough children and width. For Orientation=Horizontal, it will use as many rows as it can, given enough children and height. You can also specify a maximum number of wrapping levels (columns for Vertical, rows for Horizontal) with MaxWrappingLevels.For Vertical GreedyWrapPanels, all children elements must have the same width. For Horizontal, they must all have the same height. This was done to optimize for performance. Loosening this restriction greatly increases the level of complexity with measuring and arranging the elements

public ref class GreedyWrapPanel : System::Windows::Controls::Panel
public class GreedyWrapPanel : System.Windows.Controls.Panel
type GreedyWrapPanel = class
    inherit Panel
Public Class GreedyWrapPanel
Inherits Panel


GreedyWrapPanel() GreedyWrapPanel() GreedyWrapPanel() GreedyWrapPanel()

Initializes a new instance of GreedyWrapPanel.


ActualWrappingLevelsProperty ActualWrappingLevelsProperty ActualWrappingLevelsProperty ActualWrappingLevelsProperty

A read-only property that is the actual number of levels we are using, regardless of what MaxLevels is set to. For Orientation=Vertical, this corresponds to Columns, while for Orientation=Horizontal, this corresponds to Rows.

MaxWrappingLevelsProperty MaxWrappingLevelsProperty MaxWrappingLevelsProperty MaxWrappingLevelsProperty

Gets or sets the maximum wrapping levels.

OrientationProperty OrientationProperty OrientationProperty OrientationProperty

The orientation property.


ActualWrappingLevels ActualWrappingLevels ActualWrappingLevels ActualWrappingLevels

This property controls the direction that elements flow. If Vertical, elements flow from top to bottom. If Horizontal, elements flow from left to right.

MaxWrappingLevels MaxWrappingLevels MaxWrappingLevels MaxWrappingLevels

Gets or sets the maximum wrapping levels.

Orientation Orientation Orientation Orientation

Gets or sets the orientation.


ArrangeOverride(Size) ArrangeOverride(Size) ArrangeOverride(Size) ArrangeOverride(Size)

This method arranges the children. For Orientation=Vertical, it uses as many columns as it can, until it reaches MaxLevels. For Orientation=Horizontal, it uses the maximum number of rows possible. However, for both, their columns or rows respectively will never be more than MaxWrappingLevels.

MeasureOverride(Size) MeasureOverride(Size) MeasureOverride(Size) MeasureOverride(Size)

This method calculates the amount of space this panel will request. For Orientation=Vertical, it will use as many columns as it has space and children for.

Applies to