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, if you want to have commands executed for both left-click and right-click on a button, you wouldn't be able to accomplish that using the
Button.Command
property. This limitation is...