O'Reilly logo

Applied WPF 4 in Context by Raffaele Garofalo

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

Introduction to Commands

The Command pattern was not introduced with WPF or Silverlight. Instead, the command-handling technique is a behavioral pattern first presented in the “Gang of Four” book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Addison-Wesley, 1994). It describes how the logic of a request should be encapsulated in a separate object.

The goal is to separate the semantics and object that invoke a command from the logic that executes the command, so that the same command can be used over different UI elements without having to rewrite the execution logic. For example, the classic commands you may find in a word processing application are Copy, Cut, and ...

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