C# Class System.Windows.Markup.CommandBindingExtension

Represents a custom markup extension, which is used to bind commands to events.
Inheritance: System.Windows.Markup.MarkupExtension
Exibir arquivo Open project: lecode-official/mvvm-framework

Private Properties

Property Type Description
InvokeCommandEventHandler void

Public Methods

Method Description
CommandBindingExtension ( ) : System.Reflection

Initializes a new CommandBindingExtension instance. No command is set.

CommandBindingExtension ( PropertyPath commandPath ) : System.Reflection

Initializes a new CommandBindingExtension instance. The event arguments are not passed to the command.

CommandBindingExtension ( PropertyPath commandPath, bool passEventArgumentsToCommand ) : System.Reflection

Initializes a new CommandBindingExtension instance.

ProvideValue ( IServiceProvider serviceProvider ) : object

Provides the value of the CommandBindingExtension. It generates an event handler that is passed to the event in which theCommandBindingExtension is used.

Private Methods

Method Description
InvokeCommandEventHandler ( object sender, EventArgs e ) : void

The event handler, which is provided as a value for the target value of the CommandBindingExtension. It executes the provided command.

Method Details

CommandBindingExtension() public method

Initializes a new CommandBindingExtension instance. No command is set.
public CommandBindingExtension ( ) : System.Reflection
return System.Reflection

CommandBindingExtension() public method

Initializes a new CommandBindingExtension instance. The event arguments are not passed to the command.
public CommandBindingExtension ( PropertyPath commandPath ) : System.Reflection
commandPath PropertyPath The command to which the event is to be bound.
return System.Reflection

CommandBindingExtension() public method

Initializes a new CommandBindingExtension instance.
public CommandBindingExtension ( PropertyPath commandPath, bool passEventArgumentsToCommand ) : System.Reflection
commandPath PropertyPath The command to which the event is to be bound.
passEventArgumentsToCommand bool Determines whether the arguments of the event to which the command gets bound should be passed to the command as a parameter.
return System.Reflection

ProvideValue() public method

Provides the value of the CommandBindingExtension. It generates an event handler that is passed to the event in which theCommandBindingExtension is used.
If the service provider argument is null an exception is thrown. /// An exception is raised when the target property (the event to which the command is to be bound) could not be retrieved or when the target property is no event. ///
public ProvideValue ( IServiceProvider serviceProvider ) : object
serviceProvider IServiceProvider A service provider which gives access to the target object and target value of the
return object