Show / Hide Table of Contents

Class AsyncDelegateCommand

A that exposes the task in its asynchronous delegates for ExecuteAsync().

Inheritance
System.Object
AsyncDelegateCommand
Namespace: Phoenix.Views
Assembly: Phoenix.Abstractions.Views.dll
Syntax
public class AsyncDelegateCommand : DelegateCommand

Constructors

View Source

AsyncDelegateCommand(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.

View Source

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 Source

ExecuteAsync()

Executes the command asyncronously.

Declaration
public Task ExecuteAsync()
Returns
Type Description
System.Threading.Tasks.Task

awaitable task

  • View Source
In This Article
Back to top Generated by DocFX