Gestures, events, and commands

Classes that expose a command property in WPF and Silverlight are implementing the ICommandSource interface that is shown in the following code:

// Defines an object that knows how to invoke a command.
public interface ICommandSource
// The command that will be executed when the command
source is invoked.
ICommand Command { get; }
// Represents a user defined data value that can be
passed to the command when it is executed.
object CommandParameter { get; }
// The object that the command is being executed on.
IInputElement CommandTarget { get; }

One major limitation of the commanding infrastructure is that ICommandSource only allows for one action on a command source to be associated with a command. So, for example, ...

Get MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF now with O’Reilly online learning.

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