Frames
Thus far, we've spent a lot of time talking about the NavigationWindow, how it handles navigation,
and how it integrates with pages and page functions. However, the
navigation window is but one navigation host. A navigation host in WPF is anything that
provides navigation support. Besides the navigation window, which
provides top-level window navigation support, WPF also provides the
Frame, for contained navigation
support. For example, nothing is stopping us from hosting our guessing
game in a frame, which is itself contained by something else, as shown
in Example 11-19.
Example 11-19. Using a frame navigation host
<!-- Window1.xaml --> <Window ...> <Border BorderBrush="Green" BorderThickness="10"> <Frame Source="Page1.xaml" /> </Border> </Window>
In Example 11-19, we're hosting
a Frame in a window, but you can host
it equally well in a page. The main property you'll care about on the
Frame class is the Source, which indicates where you'd like to
start navigation. Figure 11-10
shows the results of making one guess on the history for the
frame.

Figure 11-10. Using a frame navigation host
Frames are useful when you'd like to add navigation to part of your window (or to multiple parts), but you don't want the entire window dedicated to it. For example, your average web site is composed of a set of content that goes inside a navigation frame, including menus, graphics, and so on. The ...