The previous examples used a property that binds to a single object. As we've seen in the previous chapter, a bunch of controls deriving from
ItemsControl can present information for more than one data item. It stands to reason that these controls should bind to a collection of data items, such as a collection of the
The property to be used for binding purposes is
ItemsSource. This should be set to a collection, typically
IVector<T>. Here's an example of some
Person objects bound to a
ListView (a constructor was added to person for convenient initialization):
auto people = ref new Vector<Person^>; people->Append(ref new Person(L"Bart", L"Simpson", 1990)); people->Append(ref new Person(L"Lisa", L"Simpson", 1987)); ...