ItemsControl.ItemsPanel property

Applies to Windows and Windows Phone

Gets or sets the template that defines the panel that controls the layout of items.

Syntax


public ItemsPanelTemplate ItemsPanel { get; set; }


<itemsControl>
  <itemsControl.ItemsPanel>
    singlePanelTemplate
  </itemsControl.ItemsPanel>
</itemsControl>


<itemsControl ItemsPanel="resourceReferenceToPanelTemplate"/>

XAML Values

singlePanelTemplate

A single ItemsPanelTemplate object element. That ItemsPanelTemplate would typically have multiple child elements that define the panel layout.

resourceReferenceToPanelTemplate

A resource reference to an existing ItemsPanelTemplate from a resources collection. The resource reference must specify the desired ItemsPanelTemplate by key.

Property value

Type: ItemsPanelTemplate

An ItemsPanelTemplate that defines the panel to use for the layout of the items. The default value for the ItemsControl is an ItemsPanelTemplate that specifies a StackPanel.

Remarks

Caution  ComboBox uses a CarouselPanel as its ItemsPanel. Using a different panel as the ItemsPanel of ComboBox is not supported and might result in undesired behavior.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

ItemsControl

 

 

Show:
© 2014 Microsoft