C# Class ChocoPM.Commands.DataContextCommandAdapter

A markup extension that returns an ICommand that is capable of executing methods of the DataContext of a target FrameworkElement.
When the ICommand.Execute and ICommand.CanExecute methods of the returned ICommand object are invoked, methods on the DataContext whose names correspond to the values of the Executed and CanExecute properties are invoked. See the Executed and CanExecute properties for specifics on the allowable method signatures.
Inheritance: System.Windows.Markup.MarkupExtension, ICommand
Show file Open project: RichiCoder1/ChocoPM

Public Methods

Method Description
DataContextCommandAdapter ( ) : System

Initializes a new instance of the DataContextCommandAdapter class.

DataContextCommandAdapter ( string executed ) : System

Initializes a new instance of the DataContextCommandAdapter class by using the specified method name for the Executed property.

DataContextCommandAdapter ( string executed, string canExecute ) : System

Initializes a new instance of the DataContextCommandAdapter class by using the specified method names for the Executed and CanExecute properties.

ProvideValue ( IServiceProvider serviceProvider ) : object

Returns an ICommand that is capable of executing methods of the DataContext of the target.

Private Methods

Method Description
GetDataContext ( object element ) : object
GetInputBindingsCollectionOwner ( IProvideValueTarget targetService ) : object
ICommand ( object parameter ) : bool
ICommand ( object parameter ) : void

Method Details

DataContextCommandAdapter() public method

Initializes a new instance of the DataContextCommandAdapter class.
public DataContextCommandAdapter ( ) : System
return System

DataContextCommandAdapter() public method

Initializes a new instance of the DataContextCommandAdapter class by using the specified method name for the Executed property.
public DataContextCommandAdapter ( string executed ) : System
executed string /// The name of the method. ///
return System

DataContextCommandAdapter() public method

Initializes a new instance of the DataContextCommandAdapter class by using the specified method names for the Executed and CanExecute properties.
public DataContextCommandAdapter ( string executed, string canExecute ) : System
executed string /// The name of the method. ///
canExecute string /// The name of the method. ///
return System

ProvideValue() public method

Returns an ICommand that is capable of executing methods of the DataContext of the target.
public ProvideValue ( IServiceProvider serviceProvider ) : object
serviceProvider IServiceProvider /// Object that can provide services for the markup extension. ///
return object