Constructor RelayCommand
RelayCommand(Action<T?>)
Initializes a new instance of the RelayCommand<T> class.
Declaration
public RelayCommand(Action<T?> execute)
Parameters
| Type | Name | Description | 
|---|---|---|
| Action<T> | execute | The action to execute.  | 
    
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Thrown if the action is null.  | 
    
RelayCommand(Action<T?>, Predicate<T?>)
Initializes a new instance of the RelayCommand<T> class.
Declaration
public RelayCommand(Action<T?> execute, Predicate<T?> canExecute)
Parameters
| Type | Name | Description | 
|---|---|---|
| Action<T> | execute | The action to execute.  | 
    
| Predicate<T> | canExecute | The predicate executed to determine if the command can execute.  | 
    
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Thrown if the action or the predicate is null.  |