Class RelayCommand
A command whose sole purpose is to relay its functionality to other objects by invoking delegates. The default return value for the CanExecute(object?) method is true. This type does not allow you to accept command parameters in the Execute(object?) and CanExecute(object?) callback methods.
Inherited Members
Namespace: Unity.AppUI.MVVM
Assembly: solution.dll
Syntax
public class RelayCommand : IRelayCommand, ICommand
Constructors
Name | Description |
---|---|
RelayCommand(Action?) | Initializes a new instance of the RelayCommand<T> class. |
RelayCommand(Action, Func<bool>) | Initializes a new instance of the RelayCommand<T> class. |
Methods
Name | Description |
---|---|
CanExecute() | Initializes a new instance of the RelayCommand class. |
CanExecute(object?) | Determines whether this RelayCommand can execute in its current state. |
Execute() | Defines the method to be called when the command is invoked. |
Execute(object?) | Executes the RelayCommand on the current command target. |
NotifyCanExecuteChanged() | Notifies that the CanExecuteChanged property has changed. |
Events
Name | Description |
---|---|
CanExecuteChanged | Occurs when changes occur that affect whether or not the command should execute. |