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