Prev | Current Page 457 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

Here??™s the code that would do it:
Dim win As New NavigationWindow()
win.Content = New Page1()
win.Show()
The Page Class
Like the Window class, the Page class allows a single nested element. However, the Page class
isn??™t a content control??”it actually derives directly from FrameworkElement. The Page class is
also simpler and more streamlined than the Window class. It adds a small set of properties
that allow you to customize its appearance, interact with the container in a limited way, and
use navigation. Table 9-1 lists these properties.
CHAPTER 9 n PAGES AND NAVIGATION 252
Table 9-1. Properties of the Page Class
Name Description
Background Takes a brush that allows you to set the background fill.
Content Takes the single element that??™s shown in the page. Usually, this is a
layout container, such as a Grid or a StackPanel.
Foreground, FontFamily, Determines the default appearance of text inside the page. The values
and FontSize of these properties are inherited by the elements inside the page. For
example, if you set the foreground fill and font size, by default the
content inside the page gets these details.
WindowWidth, Determines the appearance of the window that wraps your page. These
WindowHeight, and properties allow you to take control of the host by setting its width,
WindowTitle height, and caption.


Pages:
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469