9.3. Executing Commands
So far, you've taken a close look at commands, considering both the base classes and interfaces and the command library that WPF provides for you to use. However, you haven't yet seen any examples of how to use these commands.
As explained earlier, the RoutedUICommand doesn't have any hardwired functionality. It simply represents a command. To trigger this command, you need a command source (or you can use code). To respond to this command, you need a command binding that forwards execution to an ordinary event handler. You'll see both ingredients in the following sections.
9.3.1. Command Sources
The commands in the command library are always available. The easiest way to trigger them is to hook them up to a control ...
Get Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.