Show / Hide Table of Contents

Class AsyncDelegateCommand<T>

Implements IAsyncDelegateCommand<T>

Inheritance
object
AsyncDelegateCommandBase
AsyncDelegateCommand<T>
Implements
IAsyncDelegateCommand<T>
ICommand
AsyncDelegateCommandBase.CanExecuteChanged
AsyncDelegateCommandBase.RaiseCanExecuteChanged()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Presentation.Commands
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public sealed class AsyncDelegateCommand<T> : AsyncDelegateCommandBase, IAsyncDelegateCommand<T>, ICommand
Type Parameters
Name Description
T

The type of the command parameter.

Examples

The following example shows how to use the AsyncDelegateCommand<T>.

Constructors

View Source

AsyncDelegateCommand(Func<T, Task>)

Creates a new instance of the AsyncDelegateCommand<T> class.

Declaration
public AsyncDelegateCommand(Func<T, Task> executeFunc)
Parameters
Type Name Description
Func<T, Task> executeFunc

The Function executed when Execute(object) or Execute(T) is called.

View Source

AsyncDelegateCommand(Func<T, Task>, Func<T, bool>)

Creates a new instance of the AsyncDelegateCommand<T> class.

Declaration
public AsyncDelegateCommand(Func<T, Task> executeFunc, Func<T, bool> canExecute)
Parameters
Type Name Description
Func<T, Task> executeFunc

The Function executed when Execute(object) or Execute(T) is called.

Func<T, bool> canExecute

The Function that verifies whether or not AsyncCommand should execute.

Methods

View Source

CanExecute(T)

Determines whether the command can execute in its current state

Declaration
public bool CanExecute(T parameter)
Parameters
Type Name Description
T parameter

Data used by the command.

Returns
Type Description
bool

true, if this command can be executed; otherwise, false.

View Source

Execute(T)

Defines the method to be called when the command is invoked.

Declaration
public Task Execute(T parameter)
Parameters
Type Name Description
T parameter

Data used by the command.

Returns
Type Description
Task

The task object representing the asynchronous operation.

Implements

IAsyncDelegateCommand<T>
ICommand

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)

See Also

IAsyncDelegateCommand
  • View Source
Back to top Generated by DocFX