Edit

Share via


DispatcherHelper.AwaitableRunAsync Method

Definition

Overloads

AwaitableRunAsync(CoreDispatcher, Action, CoreDispatcherPriority)
Obsolete.

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher.

AwaitableRunAsync(CoreDispatcher, Func<Task>, CoreDispatcherPriority)
Obsolete.

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher.

AwaitableRunAsync<T>(CoreDispatcher, Func<Task<T>>, CoreDispatcherPriority)
Obsolete.

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task<TResult> with optional result that will be executed on the given dispatcher.

AwaitableRunAsync<T>(CoreDispatcher, Func<T>, CoreDispatcherPriority)
Obsolete.

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task<TResult> with optional result that will be executed on the given dispatcher.

AwaitableRunAsync(CoreDispatcher, Action, CoreDispatcherPriority)

Caution

This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher.

public static System.Threading.Tasks.Task AwaitableRunAsync (this Windows.UI.Core.CoreDispatcher dispatcher, Action function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
[System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")]
public static System.Threading.Tasks.Task AwaitableRunAsync (this Windows.UI.Core.CoreDispatcher dispatcher, Action function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Action * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task
[<System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")>]
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Action * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task
<Extension()>
Public Function AwaitableRunAsync (dispatcher As CoreDispatcher, function As Action, Optional priority As CoreDispatcherPriority = Windows.UI.Core.CoreDispatcherPriority.Normal) As Task

Parameters

dispatcher
Windows.UI.Core.CoreDispatcher

Dispatcher of a thread to run function.

function
Action

Function to be executed on the given dispatcher.

priority
Windows.UI.Core.CoreDispatcherPriority

Dispatcher execution priority, default is normal.

Returns

An awaitable Task for the operation.

Attributes

Remarks

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

Applies to

AwaitableRunAsync(CoreDispatcher, Func<Task>, CoreDispatcherPriority)

Caution

This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task with optional result that will be executed on the given dispatcher.

public static System.Threading.Tasks.Task AwaitableRunAsync (this Windows.UI.Core.CoreDispatcher dispatcher, Func<System.Threading.Tasks.Task> function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
[System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")]
public static System.Threading.Tasks.Task AwaitableRunAsync (this Windows.UI.Core.CoreDispatcher dispatcher, Func<System.Threading.Tasks.Task> function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Func<System.Threading.Tasks.Task> * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task
[<System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")>]
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Func<System.Threading.Tasks.Task> * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task
<Extension()>
Public Function AwaitableRunAsync (dispatcher As CoreDispatcher, function As Func(Of Task), Optional priority As CoreDispatcherPriority = Windows.UI.Core.CoreDispatcherPriority.Normal) As Task

Parameters

dispatcher
Windows.UI.Core.CoreDispatcher

Dispatcher of a thread to run function.

function
Func<Task>

Asynchronous function to be executed on the given dispatcher.

priority
Windows.UI.Core.CoreDispatcherPriority

Dispatcher execution priority, default is normal.

Returns

An awaitable Task for the operation.

Attributes

Remarks

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

Applies to

AwaitableRunAsync<T>(CoreDispatcher, Func<Task<T>>, CoreDispatcherPriority)

Caution

This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task<TResult> with optional result that will be executed on the given dispatcher.

public static System.Threading.Tasks.Task<T> AwaitableRunAsync<T> (this Windows.UI.Core.CoreDispatcher dispatcher, Func<System.Threading.Tasks.Task<T>> function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
[System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")]
public static System.Threading.Tasks.Task<T> AwaitableRunAsync<T> (this Windows.UI.Core.CoreDispatcher dispatcher, Func<System.Threading.Tasks.Task<T>> function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Func<System.Threading.Tasks.Task<'T>> * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task<'T>
[<System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")>]
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Func<System.Threading.Tasks.Task<'T>> * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function AwaitableRunAsync(Of T) (dispatcher As CoreDispatcher, function As Func(Of Task(Of T)), Optional priority As CoreDispatcherPriority = Windows.UI.Core.CoreDispatcherPriority.Normal) As Task(Of T)

Type Parameters

T

Returned data type of the function.

Parameters

dispatcher
Windows.UI.Core.CoreDispatcher

Dispatcher of a thread to run function.

function
Func<Task<T>>

Asynchronous function to be executed asynchronously on the given dispatcher.

priority
Windows.UI.Core.CoreDispatcherPriority

Dispatcher execution priority, default is normal.

Returns

Task<T>

An awaitable Task<TResult> for the operation.

Attributes

Remarks

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

Applies to

AwaitableRunAsync<T>(CoreDispatcher, Func<T>, CoreDispatcherPriority)

Caution

This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().

Extension method for Windows.UI.Core.CoreDispatcher. Offering an actual awaitable Task<TResult> with optional result that will be executed on the given dispatcher.

public static System.Threading.Tasks.Task<T> AwaitableRunAsync<T> (this Windows.UI.Core.CoreDispatcher dispatcher, Func<T> function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
[System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")]
public static System.Threading.Tasks.Task<T> AwaitableRunAsync<T> (this Windows.UI.Core.CoreDispatcher dispatcher, Func<T> function, Windows.UI.Core.CoreDispatcherPriority priority = Windows.UI.Core.CoreDispatcherPriority.Normal);
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Func<'T> * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task<'T>
[<System.Obsolete("This method should be replaced with dispatcherQueue.EnqueueAsync(function, priority). A queue can be retrieved with DispatcherQueue.GetForCurrentThread().")>]
static member AwaitableRunAsync : Windows.UI.Core.CoreDispatcher * Func<'T> * Windows.UI.Core.CoreDispatcherPriority -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function AwaitableRunAsync(Of T) (dispatcher As CoreDispatcher, function As Func(Of T), Optional priority As CoreDispatcherPriority = Windows.UI.Core.CoreDispatcherPriority.Normal) As Task(Of T)

Type Parameters

T

Returned data type of the function.

Parameters

dispatcher
Windows.UI.Core.CoreDispatcher

Dispatcher of a thread to run function.

function
Func<T>

Function to be executed on the given dispatcher.

priority
Windows.UI.Core.CoreDispatcherPriority

Dispatcher execution priority, default is normal.

Returns

Task<T>

An awaitable Task<TResult> for the operation.

Attributes

Remarks

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

Applies to