Binding to a Collection of Objects

Binding to a single object is straightforward. But life gets more interesting when you need to bind to some collection of objects—for example, all the products in a table.

Although every dependency property supports the single-value binding you've seen so far, collection binding requires an element with a bit more intelligence. In Silverlight, every control that displays a list of items derives from ItemsControl. To support collection binding, the ItemsControl class defines the key properties listed in Table 20-2.

images

At this point, you're probably wondering what types of collections you can stuff in the ItemsSource ...

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.