Table of Contents

Class AsyncShellCommand<T>

Namespace
The.WPF.Shell
Assembly
Instagile.WPF.dll
public sealed class AsyncShellCommand<T> : AsyncShellCommand, ICommand

Type Parameters

T
Inheritance
AsyncShellCommand<T>
Implements
Inherited Members

Constructors

AsyncShellCommand(ISurface, Func<T, Task>, Action<EventHandler>)

public AsyncShellCommand(ISurface surface, Func<T, Task> execute, Action<EventHandler> subscribe = null)

Parameters

surface ISurface

UI element which should handle errors.

execute Func<T, Task>

Action to run when command is invoked.

subscribe Action<EventHandler>

Optional. An Action<T> to use to subscribe to an event. The subscription will be stored in case the event uses the weak event pattern. When the event is raised, CanExecuteChanged will be raised. If null, no subscription will take place.

AsyncShellCommand(ISurface, Func<T, Task>, Func<T, bool>, Action<EventHandler>)

public AsyncShellCommand(ISurface surface, Func<T, Task> execute, Func<T, bool> canExecute, Action<EventHandler> subscribe = null)

Parameters

surface ISurface

UI element which should handle errors.

execute Func<T, Task>

Action to run when command is invoked.

canExecute Func<T, bool>

Optional. Synchronous enablement test.

subscribe Action<EventHandler>

Optional. An Action<T> to use to subscribe to an event. The subscription will be stored in case the event uses the weak event pattern. When the event is raised, CanExecuteChanged will be raised. If null, no subscription will take place.