Getting Started with the Navigation Framework

A typical business application consists of a number of views, which act as content to be displayed within an outer shell. This shell generally includes ways of navigating around the application (along with headers, footers, etc.). The project created in Chapter 1 using the Silverlight Business Application project template is a good example of this. If you haven't done so already, create a new project using this template now. In this project, you will have a shell and two views (Home and About). When you compile and run this project, you will get the user interface shown in Figure 3-1.

images

Figure 3-1. The default user interface created with the Silverlight Business Application project template

When you click the “home” and “about” buttons in the header, the view that is displayed in the body of the application's user interface will change accordingly. If you use the browser's navigation functions (i.e., the Back and Forward buttons), you can navigate through the navigation history in your application in much the same way as if it were a web site. The navigation framework provides all this functionality for you.

Looking now at the project structure (as shown in Figure 3-2) and how it relates to what you see on the screen, the MainPage.xaml file acts as the application shell, while the Home.xaml and About.xaml files in the Views folder are the individual views that are displayed as content within the shell.

images

Figure 3-2. The project structure

images Note Windows Presentation Foundation (WPF) also has a navigation framework, and the structure of the navigation framework in Silverlight was designed to be closely aligned with its WPF counterpart.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.186.92