O'Reilly logo

Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition by Matthew MacDonald

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

Advanced Commands

Now that you've seen the basics of commands, it's worth considering a few more sophisticated implementations. In the following sections, you'll learn how to use your own commands, treat the same command differently depending on the target, and use command parameters. You'll also consider how you can support a basic undo feature.

Custom Commands

As well stocked as the five command classes (ApplicationCommands, NavigationCommands, EditingCommands, ComponentCommands, and MediaCommands) are, they obviously can't provide everything your application might need. Fortunately, it's easy to define your own custom commands. All you need to do is instantiate a new RoutedUICommand object.

The RoutedUICommand class provides several constructors. ...

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