Class SimpleCommand<T>
Strongly typed variant of the SimpleCommand class, that includes type-safe actions or functions for the command parameter.
Implements
Inherited Members
Namespace: TheXDS.MCART.Component
Assembly: MCART.Mvvm.dll
Syntax
public class SimpleCommand<T> : SimpleCommand, ICommand
Type Parameters
Name | Description |
---|---|
T | Type of command parameter to be used in the command callback. |
Constructors
| Edit this page View SourceSimpleCommand(Action<T?>)
Initializes a new instance of the SimpleCommand<T> class.
Declaration
public SimpleCommand(Action<T?> action)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | Action to be executed. |
SimpleCommand(Action<T?>, bool)
Initializes a new instance of the SimpleCommand<T> class.
Declaration
public SimpleCommand(Action<T?> action, bool canExecute)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | Action to be executed. |
bool | canExecute | Indicates if the command will be executable by default. |
SimpleCommand(Func<T?, Task>)
Initializes a new instance of the SimpleCommand<T> class.
Declaration
public SimpleCommand(Func<T?, Task> task)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task> | task | Task to be executed. |
SimpleCommand(Func<T?, Task>, bool)
Initializes a new instance of the SimpleCommand<T> class.
Declaration
public SimpleCommand(Func<T?, Task> task, bool canExecute)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task> | task | Task to be executed. |
bool | canExecute | Indicates if the command will be executable by default. |