Class AsyncShellCommand<T>
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
surfaceISurfaceUI element which should handle errors.
executeFunc<T, Task>Action to run when command is invoked.
subscribeAction<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
surfaceISurfaceUI element which should handle errors.
executeFunc<T, Task>Action to run when command is invoked.
canExecuteFunc<T, bool>Optional. Synchronous enablement test.
subscribeAction<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.