Dispatcher.​Invoke​Async Method

Definition

Overloads

Invoke​Async(​Action)

Executes the specified Action asynchronously on the thread the Dispatcher is associated with.

Invoke​Async(​Action, ​Dispatcher​Priority)

Executes the specified Action asynchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke​Async(​Action, ​Dispatcher​Priority, ​Cancellation​Token)

Executes the specified Action asynchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke​Async<​TResult>(​Func<​TResult>, ​Dispatcher​Priority, ​Cancellation​Token)

Executes the specified Func<TResult> synchronously at the specified priority on the thread the Dispatcher is associated with.

Invoke​Async<​TResult>(​Func<​TResult>)

Executes the specified Func<TResult> asynchronously on the thread the Dispatcher is associated with.

Invoke​Async<​TResult>(​Func<​TResult>, ​Dispatcher​Priority)

Executes the specified Func<TResult> asynchronously at the specified priority on the thread the Dispatcher is associated with.

InvokeAsync(Action)

Executes the specified Action asynchronously on the thread the Dispatcher is associated with.

public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback);
Parameters
callback
Action

A delegate to invoke through the dispatcher.

Returns

An object, which is returned immediately after InvokeAsync(Action) is called, that can be used to interact with the delegate as it is pending execution in the event queue.

InvokeAsync(Action, DispatcherPriority)

Executes the specified Action asynchronously at the specified priority on the thread the Dispatcher is associated with.

public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority);
Parameters
callback
Action

A delegate to invoke through the dispatcher.

priority
DispatcherPriority

The priority that determines in what order the specified callback is invoked relative to the other pending operations in the Dispatcher.

Returns

An object, which is returned immediately after InvokeAsync(Action, DispatcherPriority) is called, that can be used to interact with the delegate as it is pending execution in the event queue.

InvokeAsync(Action, DispatcherPriority, CancellationToken)

Executes the specified Action asynchronously at the specified priority on the thread the Dispatcher is associated with.

public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
Parameters
callback
Action

A delegate to invoke through the dispatcher.

priority
DispatcherPriority

The priority that determines in what order the specified callback is invoked relative to the other pending operations in the Dispatcher.

cancellationToken
CancellationToken

An object that indicates whether to cancel the action.

Returns

An object, which is returned immediately after InvokeAsync(Action, DispatcherPriority, CancellationToken) is called, that can be used to interact with the delegate as it is pending execution in the event queue.

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken)

Executes the specified Func<TResult> synchronously at the specified priority on the thread the Dispatcher is associated with.

public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
Type Parameters
TResult

The return value type of the specified delegate.

Parameters
callback
Func<TResult>

A delegate to invoke through the dispatcher.

priority
DispatcherPriority

The priority that determines in what order the specified callback is invoked relative to the other pending operations in the Dispatcher.

cancellationToken
CancellationToken

An object that indicates whether to cancel the operation.

Returns

An object, which is returned immediately after InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) is called, that can be used to interact with the delegate as it is pending execution in the event queue.

InvokeAsync<TResult>(Func<TResult>)

Executes the specified Func<TResult> asynchronously on the thread the Dispatcher is associated with.

public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback);
Type Parameters
TResult

The return value type of the specified delegate.

Parameters
callback
Func<TResult>

A delegate to invoke through the dispatcher.

Returns

An object, which is returned immediately after InvokeAsync<TResult>(Func<TResult>) is called, that can be used to interact with the delegate as it is pending execution in the event queue.

InvokeAsync<TResult>(Func<TResult>, DispatcherPriority)

Executes the specified Func<TResult> asynchronously at the specified priority on the thread the Dispatcher is associated with.

public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority);
Type Parameters
TResult

The return value type of the specified delegate.

Parameters
callback
Func<TResult>

A delegate to invoke through the dispatcher.

priority
DispatcherPriority

The priority that determines in what order the specified callback is invoked relative to the other pending operations in the Dispatcher.

Returns

An object, which is returned immediately after InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) is called, that can be used to interact with the delegate as it is pending execution in the event queue.