Items Controls

Controls that wrap collections of items generally derive from the ItemsControl class. Silverlight provides four list-based controls. You'll take a look at the ListBox, the ComboBox, and the TabControl in this section. You'll explore the TreeView in Chapter 21.

The ItemsControl class fills in the basic plumbing that's used by all list-based controls. Notably, it gives you two ways to fill the list of items. The most straightforward approach is to add them directly to the Items collection, using code or XAML. This is the approach you'll see in this chapter. However, if you need to display a dynamic list, it's more common to use data binding. In this case, you set the ItemsSource property to the object that has the collection of data ...

Get Pro Silverlight 5 in VB 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.