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 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.