C# Class ChocoPM.Commands.DataContextCommandBinding

A RoutedCommandBinding implementation that handles a RoutedCommand by executing methods of the DataContext of the UIElement whose UIElement.CommandBindings collection contains the DataContextCommandBinding.
Inheritance: RoutedCommandBinding
Show file Open project: RichiCoder1/ChocoPM

Public Methods

Method Description
DataContextCommandBinding ( ) : System.Windows

Initializes a new instance of the DataContextCommandBinding class.

DataContextCommandBinding ( ICommand command ) : System.Windows

Initializes a new instance of the DataContextCommandBinding class by using the specified ICommand.

Protected Methods

Method Description
OnCanExecute ( object sender, System.Windows.Input.CanExecuteRoutedEventArgs e ) : void

The method that is called when the CanExecute RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.

OnExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

The method that is called when the Executed RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.

OnPreviewCanExecute ( object sender, System.Windows.Input.CanExecuteRoutedEventArgs e ) : void

The method that is called when the PreviewCanExecute RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.

OnPreviewExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

The method that is called when the PreviewExecuted RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.

Private Methods

Method Description
GetDataContext ( object element ) : object

Method Details

DataContextCommandBinding() public method

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

DataContextCommandBinding() public method

Initializes a new instance of the DataContextCommandBinding class by using the specified ICommand.
public DataContextCommandBinding ( ICommand command ) : System.Windows
command ICommand
return System.Windows

OnCanExecute() protected method

The method that is called when the CanExecute RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.
protected OnCanExecute ( object sender, System.Windows.Input.CanExecuteRoutedEventArgs e ) : void
sender object The command target on which the command is executing.
e System.Windows.Input.CanExecuteRoutedEventArgs The event data.
return void

OnExecuted() protected method

The method that is called when the Executed RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.
protected OnExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void
sender object The command target on which the command is executing.
e System.Windows.Input.ExecutedRoutedEventArgs The event data.
return void

OnPreviewCanExecute() protected method

The method that is called when the PreviewCanExecute RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.
protected OnPreviewCanExecute ( object sender, System.Windows.Input.CanExecuteRoutedEventArgs e ) : void
sender object The command target on which the command is executing.
e System.Windows.Input.CanExecuteRoutedEventArgs The event data.
return void

OnPreviewExecuted() protected method

The method that is called when the PreviewExecuted RoutedEvent for the ICommand associated with this DataContextCommandBinding should be handled.
protected OnPreviewExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void
sender object The command target on which the command is executing.
e System.Windows.Input.ExecutedRoutedEventArgs The event data.
return void