Dispatcher.InvokeAsync Dispatcher.InvokeAsync Dispatcher.InvokeAsync Dispatcher.InvokeAsync Method

Definition

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

Overloads

InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action)

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

InvokeAsync(Action, DispatcherPriority) InvokeAsync(Action, DispatcherPriority) InvokeAsync(Action, DispatcherPriority) InvokeAsync(Action, DispatcherPriority)

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

InvokeAsync(Action, DispatcherPriority, CancellationToken) InvokeAsync(Action, DispatcherPriority, CancellationToken) InvokeAsync(Action, DispatcherPriority, CancellationToken)

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

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

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

InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>)

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

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

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

InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action)

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

public:
 System::Windows::Threading::DispatcherOperation ^ InvokeAsync(Action ^ callback);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback);
member this.InvokeAsync : Action -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action) As DispatcherOperation
Parameters
callback
Action Action Action 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) InvokeAsync(Action, DispatcherPriority) InvokeAsync(Action, DispatcherPriority) 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);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority);
member this.InvokeAsync : Action * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action, priority As DispatcherPriority) As DispatcherOperation
Parameters
callback
Action Action Action Action

A delegate to invoke through the dispatcher.

priority
DispatcherPriority DispatcherPriority DispatcherPriority 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) InvokeAsync(Action, DispatcherPriority, CancellationToken) 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);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
member this.InvokeAsync : Action * System.Windows.Threading.DispatcherPriority * System.Threading.CancellationToken -> System.Windows.Threading.DispatcherOperation
Parameters
callback
Action Action Action Action

A delegate to invoke through the dispatcher.

priority
DispatcherPriority DispatcherPriority DispatcherPriority DispatcherPriority

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

cancellationToken
CancellationToken CancellationToken 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) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) 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:
generic <typename TResult>
 System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback, System::Windows::Threading::DispatcherPriority priority, System::Threading::CancellationToken cancellationToken);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
member this.InvokeAsync : Func<'Result> * System.Windows.Threading.DispatcherPriority * System.Threading.CancellationToken -> System.Windows.Threading.DispatcherOperation<'Result>
Type Parameters
TResult

The return value type of the specified delegate.

Parameters
callback
Func<TResult> Func<TResult> Func<TResult> Func<TResult>

A delegate to invoke through the dispatcher.

priority
DispatcherPriority DispatcherPriority DispatcherPriority DispatcherPriority

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

cancellationToken
CancellationToken CancellationToken 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>) InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>) InvokeAsync<TResult>(Func<TResult>)

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

public:
generic <typename TResult>
 System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback);
member this.InvokeAsync : Func<'Result> -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult)) As DispatcherOperation(Of TResult)
Type Parameters
TResult

The return value type of the specified delegate.

Parameters
callback
Func<TResult> Func<TResult> Func<TResult> 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) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) InvokeAsync<TResult>(Func<TResult>, DispatcherPriority)

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

public:
generic <typename TResult>
 System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback, System::Windows::Threading::DispatcherPriority priority);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority);
member this.InvokeAsync : Func<'Result> * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult), priority As DispatcherPriority) As DispatcherOperation(Of TResult)
Type Parameters
TResult

The return value type of the specified delegate.

Parameters
callback
Func<TResult> Func<TResult> Func<TResult> Func<TResult>

A delegate to invoke through the dispatcher.

priority
DispatcherPriority DispatcherPriority DispatcherPriority 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.

Applies to