Items Controls

Just as the ContentControl plays host to a single child control, the ItemsControl can have many children. Controls that can contain more than one child usually derive from the ItemsControl class; these include the ComboBox control and, most notably, the ListBox control (see Figure 5.11).

Image

FIGURE 5.11 ComboBox and ListBox are derived from ItemsControl.

An ItemsControl allows you to populate its children either directly in XAML or in code using the ItemsControl.Items property, or indirectly using a data binding and the ItemsControl.ItemsSource property.

The Selector class extends the ItemsControl to provide the properties and events ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.