Edit

Share via


DispatcherQueueExtensions.EnqueueAsync Method

Definition

Overloads

EnqueueAsync(DispatcherQueue, Action, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task that completes when the invocation of the function is completed.

EnqueueAsync(DispatcherQueue, Func<Task>, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task that acts as a proxy for the one returned by the given function.

EnqueueAsync<T>(DispatcherQueue, Func<Task<T>>, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task<TResult> that acts as a proxy for the one returned by the given function.

EnqueueAsync<T>(DispatcherQueue, Func<T>, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task<TResult> that completes when the invocation of the function is completed.

EnqueueAsync(DispatcherQueue, Action, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task that completes when the invocation of the function is completed.

public static System.Threading.Tasks.Task EnqueueAsync (this Windows.System.DispatcherQueue dispatcher, Action function, Windows.System.DispatcherQueuePriority priority = Windows.System.DispatcherQueuePriority.Normal);
static member EnqueueAsync : Windows.System.DispatcherQueue * Action * Windows.System.DispatcherQueuePriority -> System.Threading.Tasks.Task
<Extension()>
Public Function EnqueueAsync (dispatcher As DispatcherQueue, function As Action, Optional priority As DispatcherQueuePriority = Windows.System.DispatcherQueuePriority.Normal) As Task

Parameters

dispatcher
Windows.System.DispatcherQueue

The target Windows.System.DispatcherQueue to invoke the code on.

function
Action

The Action to invoke.

priority
Windows.System.DispatcherQueuePriority

The priority level for the function to invoke.

Returns

A Task that completes when the invocation of function is over.

Remarks

If the current thread has access to dispatcher, function will be invoked directly.

Applies to

EnqueueAsync(DispatcherQueue, Func<Task>, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task that acts as a proxy for the one returned by the given function.

public static System.Threading.Tasks.Task EnqueueAsync (this Windows.System.DispatcherQueue dispatcher, Func<System.Threading.Tasks.Task> function, Windows.System.DispatcherQueuePriority priority = Windows.System.DispatcherQueuePriority.Normal);
static member EnqueueAsync : Windows.System.DispatcherQueue * Func<System.Threading.Tasks.Task> * Windows.System.DispatcherQueuePriority -> System.Threading.Tasks.Task
<Extension()>
Public Function EnqueueAsync (dispatcher As DispatcherQueue, function As Func(Of Task), Optional priority As DispatcherQueuePriority = Windows.System.DispatcherQueuePriority.Normal) As Task

Parameters

dispatcher
Windows.System.DispatcherQueue

The target Windows.System.DispatcherQueue to invoke the code on.

function
Func<Task>

The Func<TResult> to invoke.

priority
Windows.System.DispatcherQueuePriority

The priority level for the function to invoke.

Returns

A Task that acts as a proxy for the one returned by function.

Remarks

If the current thread has access to dispatcher, function will be invoked directly.

Applies to

EnqueueAsync<T>(DispatcherQueue, Func<Task<T>>, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task<TResult> that acts as a proxy for the one returned by the given function.

public static System.Threading.Tasks.Task<T> EnqueueAsync<T> (this Windows.System.DispatcherQueue dispatcher, Func<System.Threading.Tasks.Task<T>> function, Windows.System.DispatcherQueuePriority priority = Windows.System.DispatcherQueuePriority.Normal);
static member EnqueueAsync : Windows.System.DispatcherQueue * Func<System.Threading.Tasks.Task<'T>> * Windows.System.DispatcherQueuePriority -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function EnqueueAsync(Of T) (dispatcher As DispatcherQueue, function As Func(Of Task(Of T)), Optional priority As DispatcherQueuePriority = Windows.System.DispatcherQueuePriority.Normal) As Task(Of T)

Type Parameters

T

The return type of function to relay through the returned Task<TResult>.

Parameters

dispatcher
Windows.System.DispatcherQueue

The target Windows.System.DispatcherQueue to invoke the code on.

function
Func<Task<T>>

The Func<TResult> to invoke.

priority
Windows.System.DispatcherQueuePriority

The priority level for the function to invoke.

Returns

Task<T>

A Task<TResult> that relays the one returned by function.

Remarks

If the current thread has access to dispatcher, function will be invoked directly.

Applies to

EnqueueAsync<T>(DispatcherQueue, Func<T>, DispatcherQueuePriority)

Invokes a given function on the target Windows.System.DispatcherQueue and returns a Task<TResult> that completes when the invocation of the function is completed.

public static System.Threading.Tasks.Task<T> EnqueueAsync<T> (this Windows.System.DispatcherQueue dispatcher, Func<T> function, Windows.System.DispatcherQueuePriority priority = Windows.System.DispatcherQueuePriority.Normal);
static member EnqueueAsync : Windows.System.DispatcherQueue * Func<'T> * Windows.System.DispatcherQueuePriority -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function EnqueueAsync(Of T) (dispatcher As DispatcherQueue, function As Func(Of T), Optional priority As DispatcherQueuePriority = Windows.System.DispatcherQueuePriority.Normal) As Task(Of T)

Type Parameters

T

The return type of function to relay through the returned Task<TResult>.

Parameters

dispatcher
Windows.System.DispatcherQueue

The target Windows.System.DispatcherQueue to invoke the code on.

function
Func<T>

The Func<TResult> to invoke.

priority
Windows.System.DispatcherQueuePriority

The priority level for the function to invoke.

Returns

Task<T>

A Task that completes when the invocation of function is over.

Remarks

If the current thread has access to dispatcher, function will be invoked directly.

Applies to