The WPF Command Model

The WPF command model consists of a surprising number of moving parts. All together, it has four key ingredients:

  • Commands. A command represents an application task and keeps track of whether it can be executed. However, commands don't actually contain the code that performs the application task.

  • Command bindings. Each command binding links a command to the related application logic, for a particular area of your user interface. This factored design is important, because a single command might be used in several places in your application and have a different significance in each place. To handle this, you use the same command with different command bindings.

  • Command sources. A command source triggers a command. For example, ...

Get Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.