Skip to Main Content
Programming WPF, 2nd Edition
book

Programming WPF, 2nd Edition

by Chris Sells, Ian Griffiths
August 2007
Intermediate to advanced content levelIntermediate to advanced
864 pages
25h 52m
English
O'Reilly Media, Inc.
Content preview from Programming WPF, 2nd Edition

Chapter 10. Windows and Dialogs

The Window class, mentioned in Chapter 2, is the required class for the application's main window. To fit in with the rest of the Windows applications, the WPF Window class is flexible. It supports building top-level style main windows and dialogs, which we'll discuss in this chapter, as well as serving as the base class for the NavigationWindow, which we'll discuss in the next chapter.

Window

In Chapter 2, we looked at the lifetime and services of an application, often as related to the windows that constitute the UI of the application. However, we didn't talk much about the windows themselves. The Window class derives from the ContentControl (described in Chapter 5) and adds the chrome around the edges that contains the title; the minimize, maximize, and close buttons; and so on. The content can look however you want. The chrome itself has more limited options.

Window Look and Feel

The look and feel of the frame of a window is largely determined by the Icon, Title, and WindowStyle properties, the latter of which has four options (None, SingleBorderWindow, ThreeDBorderWindow, and ToolWindow), shown in Figure 10-1 (the default is SingleBorderWindow).

Window styles in Windows Vista and Windows XP

Figure 10-1. Window styles in Windows Vista and Windows XP

You'll notice that the icon and/or title are shown or not depending on the window style. You'll also notice that the None WindowStyle still contains ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming C#, 4th Edition

Programming C#, 4th Edition

Jesse Liberty
Programming C# 10

Programming C# 10

Ian Griffiths

Publisher Resources

ISBN: 9780596510374Supplemental ContentErrata Page