ItemsControl
Introduction
ItemsControl provides a way to display a collection of controls. By default all contained controls are stacked and allow scrolling with a ScrollBar.
ItemsControl inherits from ScrollViewer. For more information about inherited proerties, see the ScrollViewer page.
Code Example: Adding to Items Property
If an object is added to the Items property then the ItemsControl creates a view to represent this. By default this is a Label instance, but it can be customized through the VisualTemplate property.
The following code creates ten Labels by adding integers to the Items property.
var itemsControl = new ItemsControl();
itemsControl.AddToRoot();
for(int i = 0; i < 10; i++)
{
itemsControl.Items.Add(i);
}
Last updated
Was this helpful?

