RelayCommand<T>
References- RelayValueCommand<TParameter, TValue>
- RelayValueCommand<TValue>
Command to relay execution and execute state to delegates
Type parameters:
| T |
Constructors
RelayCommand
#Initializes a new instance of the RelayCommand<T> 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 UpdateCanExecute() to tell the control that is bound to this command to call the delegate again.RelayCommand
#Initializes a new instance of the RelayCommand<T> class.
Remarks: The CanExecute(object) will always return true.
Parameters:
| execute (Action<T>) | Delegate to execute the command. |
Methods
CanExecute
#Determines whether this command can execute with the specified parameter.
Parameters:
| parameter (object) | Command argument from the control. |
Returns:
true if this command can execute; otherwise, false.Execute
#Executes the command with the specified parameter.
Parameters:
| parameter (object) | Command argument from the control. |
UpdateCanExecute
#public void UpdateCanExecute()
Tells consumers of this command that the CanExecute(object) state has changed and should be queried again.