Class AsyncShellCommand
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
surfaceISurfaceUI element which should handle errors.
executeFunc<object, Task>Action to run when command is invoked.
canExecuteFunc<object, 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.
AsyncShellCommand(ISurface, Func<Task>, Func<bool>, Action<EventHandler>)
public AsyncShellCommand(ISurface surface, Func<Task> execute, Func<bool> canExecute = null, Action<EventHandler> subscribe = null)
Parameters
surfaceISurfaceUI element which should handle errors.
executeFunc<Task>Action to run when command is invoked.
canExecuteFunc<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.