Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.58 KB

itemsstackpanel.md

File metadata and controls

43 lines (30 loc) · 1.58 KB
-api-id -api-type
T:Microsoft.UI.Xaml.Controls.ItemsStackPanel
winrt class

Microsoft.UI.Xaml.Controls.ItemsStackPanel

-description

Arranges child elements of an ItemsControl into a single line that can be oriented horizontally or vertically. Supports pixel-based UI virtualization and grouped layouts.

-xaml-syntax

<ItemsStackPanel .../>

-remarks

ItemsStackPanel can be used only as the ItemsPanel of an ItemsControl that displays more than one item at a time. It can't be used with an ItemsControl that displays only one item at a time, such as a ComboBox or FlipView. ItemsStackPanel is the default ItemsPanel for ListView.

By default, the ItemsStackPanel stacks items vertically from top to bottom. You can set the Orientation property to Horizontal to stack items from left to right.

-examples

This example shows how to use an ItemsStackPanel to display ListView items stacked horizontally.

<ListView>
    <ListView.ItemsPanel> 
        <ItemsPanelTemplate>
            <ItemsStackPanel Orientation="Horizontal"/>  
        </ItemsPanelTemplate> 
    </ListView.ItemsPanel> 
</ListView> 

-see-also

Panel, Orientation enumeration