Dialogs

Unlike the main window, where users can interact with any number of menu items, toolbar buttons, and data controls at will, a dialog is most often meant to be a short, focused conversation with the user to get some specific data before the rest of the application can continue. The File dialog is the classic example; when the application needs the name of a file, the File dialog provides a way for the user to specify it.

In Windows, dialogs were originally designed as modal (i.e., the application has entered a "mode" where the user must answer the questions posed by the dialog and click OK, or must abort the operation by clicking the Cancel button). However, it didn't take long for dialogs to need to continue running in concert with other accessible windows, leading to modeless operation, where the user can go back and forth between the dialog and other windows, using each at will. The Find dialog is the exemplar in this area. As users find something they've specified in the Find dialog, they're free to interact with that data without dismissing the Find dialog so that they can find the next thing that matches their query without starting over.

* For a multiple-monitor-safe version of this sample, check out the "Save Window Placement State Sample" in the SDK: http://msdn2.microsoft.com/en-gb/library/aa972 1 63.aspx (http://tinysells.com/103).

In WPF, there is no special dialog class. Dialog interactions, both modal and modeless, are provided by either the Window or the NavigationWindow (discussed in the next chapter) as you choose. However, there is built-in support for dialog-like interactions with WPF application users, including modal operation, dialog styles, and data validation, as we'll explore in this chapter. And there are a few common dialog classes, which we'll explore now.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment