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