|Figure 15. Hierarchy of Three: This hierarchical navigation application has pages 2 and 3 returning always to page 1.|
In a WPF app with hierarchical navigation, users can branch out to other pages based on their choice. Figure 15
shows a typical hierarchical navigation application. Note that each page can branch out to as many pages as required, but as each page exits it will return to its calling page.
Figure 16 shows an example implementation of the hierarchical navigation application shown in Figure 15. In the first page, the user can enter his name and to select his country, he can click on the Select Country button to load the second page. To select his industry, he can click on the Select Industry button to load the third page. The pages for selecting country and industry both return to Page 1.
Once the selections are made, the results are shown on the main page, which serves as the master page for the entire application (see Figure 17).
Listing 1 is the codebroken into six sectionsof the code for the three pages. Please be careful to heed the breaks in this code. Subheads are given.
Figure 16. Two Child Pages: An implementation of a hierarchical navigation application is shown.
Figure 17. Back to the Beginning: Data entered from the other pages are shown in Page1.xaml.
In this article, you have seen an overview, and two simple drill-downs, on how to paginate applications in the Windows Presentation Framework (Avalon). You have seen the five types of PageFunction pages available. In the next article, I will show you how data-binding is done in Avalon.