O'Reilly logo

MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF by Muhammad Shujaat Siddiqi, Ryan Vice

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

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

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