Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.78 KB

listboxitem.md

File metadata and controls

41 lines (30 loc) · 1.78 KB
-api-id -api-type
T:Windows.UI.Xaml.Controls.ListBoxItem
winrt class

Windows.UI.Xaml.Controls.ListBoxItem

-description

Represents the container for an item in a ListBox control.

-xaml-syntax

<ListBoxItem .../>
-or-
<ListBoxItem ...>
  content
</ListBoxItem>

-remarks

The ListBoxItem class provides the container for items displayed in a ListBox control. You populate the ListBox by adding ListBoxItems directly to its Items collection or by binding its ItemsSource property to a data source. When items are added to the ListBox, a ListBoxItem container is created automatically for each item in the collection.

You can specify the look of the ListBoxItem by setting the ListBox's ItemContainerStyle property to a Style with a TargetType of ListBoxItem.

-examples

Tip

For more info, design guidance, and code examples, see List boxes.

If you have the WinUI 2 Gallery app installed, click here to open the app and see the ListBox in action.

-see-also

SelectorItem, ListBox, ItemContainerStyle