In Tutorial #2, Data Binding, we explored how to bind relatively simple data to relatively simple
controls. This tutorial will dive a bit deeper, looking specifically at two topics that are of
particular importance in DataBinding:
While we did have a list of chapter names that we bound to a list box in the previous chapter that was not quite complex enough to raise the question of DataTemplates; in this tutorial we'll look at what happens when you bind more complicated objects, that have numerous properties, to a list control.
A quick look at Figure 7-1 shows that we're listing each book in a collection, formatting the
name in red and Comic Sans MS, 16 point, while we're formatting the rest of the line, which
includes the Book's ISBN and cover price in Verdana, black, 14 point. How we are doing that is
not yet obvious. Nor is it obvious where the information (book title, ISBN or price) is coming
When the user clicks on a book it is highlighted, and the list box literally shrinks down to make
room for the details about the book. What is now visible is 6 rows of information about the book,
including a list of authors bound to a smaller list box, a few rows of strings and integers, and a
rating displayed both in a slider and a TextBlock.
This tutorial will show how to create bindings both to lists and to individual controls using
Blend; giving you more leverage, more quickly, and, like any good development environment,
allowing you to focus on what you are trying to build rather than on the specific syntax of
This action might not be possible to undo. Are you sure you want to continue?