Table of Contents

Class AsyncShellCommand

Namespace
The.WPF.Shell
Assembly
Instagile.WPF.dll
public class AsyncShellCommand : ShellCommand, ICommand
Inheritance
AsyncShellCommand
Implements
Derived
Inherited Members

Constructors

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

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

Parameters

surface ISurface

UI element which should handle errors.

execute Func<object, Task>

Action to run when command is invoked.

canExecute Func<object, 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.

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

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

Parameters

surface ISurface

UI element which should handle errors.

execute Func<Task>

Action to run when command is invoked.

canExecute Func<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.