Creating a master-detail view

A master-detail view is a common way to display lots of information. The master shows a compressed view of some objects, while the detail view shows the selected object (from the master) in greater detail, as appropriate. Let's examine a typical way to achieve this in WPF.

Getting ready

Make sure Visual Studio is up and running.

How to do it...

We'll create an application that shows a list of processes and a detailed look of a selected process.

  1. Create a new WPF application named CH06.MasterDetail.
  2. Open MainWindow.xaml. Add the following markup to the existing Grid, creating two columns with first holding a ListBox:
    <Grid.ColumnDefinitions> <ColumnDefinition Width="200"/> <ColumnDefinition /> </Grid.ColumnDefinitions> <ListBox ...

Get Windows Presentation Foundation 4.5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.