Chapter 15. More Data Binding

Data Templates

In Chapter 8 you saw how to bind a control to a collection of data objects. In Chapter 13 you saw how to replace the default appearance of a control with an appearance of your own design. In this chapter, I'll combine and extend these two concepts and show you how to specify the appearance of data you've mapped to a control.

In the example at the end of Chapter 8, I mapped a set of data about four people, to a ComboBox control. For the first example in this chapter, I've modified that program so that the ComboBox is a now ListBox and is at the left of the window, as shown in Figure 15-1.

When the user selects an item in the ListBox, the panel to the right of the ListBox displays the information about that ...

Get Illustrated WPF 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.