O'Reilly logo

Sams Teach Yourself WPF in 24 Hours by Christopher Bennage, Rob Eisenberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Output

What You’ll Learn in This Hour:

  • Printing

  • Visuals

  • Bitmaps

Up to now, we have focused almost entirely on the capability of WPF to render output to users via a graphical display. WPF has many capabilities, though, and is not limited to this single form of output. Modern software must enable users to consume their data in a variety of formats.

Making the Text Editor Print

At this point, our text editor is almost finished. One major feature is missing: printing. It turns out that printing the contents of a RichTextBox is quite easy. Let’s get to it:

  1. Open the Text Editor project in Visual Studio and open the MainWindow.xaml file.

  2. Add the following to the window’s CommandBindings:

    <CommandBinding Command="ApplicationCommands.Print"
                    Executed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required