Class AsyncDelegateCommand<T>
A
Inheritance
Namespace: Phoenix.Views
Assembly: Phoenix.Abstractions.Views.dll
Syntax
public class AsyncDelegateCommand<T> : DelegateCommand<T>
Type Parameters
Name | Description |
---|---|
T | Parameter type. |
Constructors
View SourceAsyncDelegateCommand(Func<T, Task>)
Creates a new instance of AsyncDelegateCommand with the System.Func<T, TResult> to invoke on execution.
Declaration
public AsyncDelegateCommand(Func<T, Task> executeMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Threading.Tasks.Task> | executeMethod | The System.Func<T, TResult> to invoke when System.Windows.Input.ICommand.Execute(System.Object) is called. |
AsyncDelegateCommand(Func<T, Task>, Func<T, Boolean>)
Creates a new instance of AsyncDelegateCommand with the System.Func<T, TResult> to invoke on execution and a Func to query for determining if the command can execute.
Declaration
public AsyncDelegateCommand(Func<T, Task> executeMethod, Func<T, bool> canExecuteMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Threading.Tasks.Task> | executeMethod | The System.Func<T, TResult> to invoke when System.Windows.Input.ICommand.Execute(System.Object) is called. |
System.Func<T, System.Boolean> | canExecuteMethod | The System.Func<T, TResult> to invoke when System.Windows.Input.ICommand.CanExecute(System.Object) is called |
Methods
View SourceExecuteAsync(T)
Executes the command asyncronously.
Declaration
public Task ExecuteAsync(T parameter)
Parameters
Type | Name | Description |
---|---|---|
T | parameter | The parameter for the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | awaitable task |