O'Reilly logo

Windows Presentation Foundation 4.5 Cookbook by Pavel Yosifovich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required