Class RelayCommand<T>
Implementation of IRelayCommand that allows for CommandParameter to be passed in.
Inherited Members
Namespace: Unity.AppUI.MVVM
Assembly: solution.dll
Syntax
public class RelayCommand<T> : IRelayCommand<T>, IRelayCommand, ICommand
Type Parameters
| Name | Description |
|---|---|
| T | The type of the CommandParameter. |
Constructors
| Name | Description |
|---|---|
| RelayCommand(Action<T?>) | Initializes a new instance of the RelayCommand<T> class. |
| RelayCommand(Action<T?>, Predicate<T?>) | Initializes a new instance of the RelayCommand<T> class. |
Methods
| Name | Description |
|---|---|
| CanExecute(object?) | Determines whether this RelayCommand<T> can execute in its current state. |
| CanExecute(T?) | Determines whether this RelayCommand<T> can execute in its current state. |
| Execute(object?) | Executes the RelayCommand<T> on the current command target. |
| Execute(T?) | Executes the RelayCommand<T> on the current command target. |
| NotifyCanExecuteChanged() | Notifies that the CanExecuteChanged property has changed. |
Events
| Name | Description |
|---|---|
| CanExecuteChanged | Event raised when CanExecute(object?) changes. |