Compartir a través de


AsyncCommand Class

Definition

A generic implementation of IAsyncCommand that invokes an async callback when executed.

public class AsyncCommand : Microsoft.VisualStudio.Extensibility.UI.NotifyPropertyChangedObject, Microsoft.VisualStudio.Extensibility.UI.IAsyncCommand
type AsyncCommand = class
    inherit NotifyPropertyChangedObject
    interface IAsyncCommand
Public Class AsyncCommand
Inherits NotifyPropertyChangedObject
Implements IAsyncCommand
Inheritance
Implements

Constructors

AsyncCommand(Func<Object,CancellationToken,Task>)

Initializes a new instance of the AsyncCommand class.

AsyncCommand(Func<Object,IClientContext,CancellationToken,Task>)

Initializes a new instance of the AsyncCommand class.

Properties

CanExecute

Gets a value indicating whether the command can execute in its current state.

Methods

ExecuteAsync(Object, IClientContext, CancellationToken)

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

RaiseNotifyPropertyChangedEvent(String)

Raises the PropertyChanged event.

(Inherited from NotifyPropertyChangedObject)
SetProperty<T>(T, T, String)

Sets the value of a property's backing field and raises PropertyChanged.

If the value of storage is already the same as value, storage is not updated and PropertyChanged is not raised. This comparison is performed with the default EqualityComparer<T> when T is a value types or a string, with ReferenceEquals(Object, Object) otherwise.

This method should be called from inside a property setter.

(Inherited from NotifyPropertyChangedObject)

Events

PropertyChanged (Inherited from NotifyPropertyChangedObject)

Applies to