RelayCommand

RelayCommand<1>
Command to relay execution and execute state to delegates

Constructors

RelayCommand

#
public RelayCommand(Action execute, Func<bool> canExecute)
Initializes a new instance of the RelayCommand class.
Remarks: This constructor allows you to specify whether the command can be executed. If the state of the canExecute delegate changes, you can call RelayCommand<T>.UpdateCanExecute() to tell the control that is bound to this command to call the delegate again.
execute (Action)Delegate to execute the command.
canExecute (Func<bool>)Delegate to determine the state of whether the command can be executed.

RelayCommand

#
public RelayCommand(Action execute)
Initializes a new instance of the RelayCommand class.

Methods

CanExecute

public bool CanExecute(object parameter)
Determines whether this command can execute with the specified parameter.
inherited fromRelayCommand<T>
parameter (object)Command argument from the control.
true if this command can execute; otherwise, false.

Execute

public void Execute(object parameter)
Executes the command with the specified parameter.
inherited fromRelayCommand<T>

UpdateCanExecute

public void UpdateCanExecute()
Tells consumers of this command that the RelayCommand<T>.CanExecute(object) state has changed and should be queried again.
inherited fromRelayCommand<T>

Events