Using the common dialog boxes
Windows has its own built-in dialog boxes for common operations, such as opening files, saving a file, and printing. Using these dialogs is very intuitive from the user's perspective, because she has probably used those dialogs before in other applications. WPF wraps some of these (native) dialogs. In this recipe, we'll see how to use some of the common dialogs.
Make sure Visual Studio is up and running.
How to do it...
We'll create a simple image viewer that uses the Open common dialog box to allow the user to select an image file to view:
- Create a new WPF Application named
MainWindow.xaml. Add the following markup to the existing
<Grid.RowDefinitions> <RowDefinition Height="Auto" ...