Share via


Device.InvokeOnMainThreadAsync Method

Definition

Overloads

InvokeOnMainThreadAsync(Action)

Invokes an Action on the device main (UI) thread.

InvokeOnMainThreadAsync(Func<Task>)

Invokes a Func on the device main (UI) thread.

InvokeOnMainThreadAsync<T>(Func<T>)

Invokes a Func on the device main (UI) thread.

InvokeOnMainThreadAsync<T>(Func<Task<T>>)

Invokes a Func on the device main (UI) thread.

InvokeOnMainThreadAsync(Action)

Invokes an Action on the device main (UI) thread.

public static System.Threading.Tasks.Task InvokeOnMainThreadAsync (Action action);
static member InvokeOnMainThreadAsync : Action -> System.Threading.Tasks.Task

Parameters

action
System.Action

The Action to invoke

Returns

System.Threading.Tasks.Task

Applies to

InvokeOnMainThreadAsync(Func<Task>)

Invokes a Func on the device main (UI) thread.

public static System.Threading.Tasks.Task InvokeOnMainThreadAsync (Func<System.Threading.Tasks.Task> funcTask);
static member InvokeOnMainThreadAsync : Func<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task

Parameters

funcTask
System.Func<System.Threading.Tasks.Task>

The Func to invoke.

Returns

System.Threading.Tasks.Task

Applies to

InvokeOnMainThreadAsync<T>(Func<T>)

Invokes a Func on the device main (UI) thread.

public static System.Threading.Tasks.Task<T> InvokeOnMainThreadAsync<T> (Func<T> func);
static member InvokeOnMainThreadAsync : Func<'T> -> System.Threading.Tasks.Task<'T>

Type Parameters

T

The return type of the Func.

Parameters

func
System.Func<T>

The Func to invoke.

Returns

System.Threading.Tasks.Task<T>

Applies to

InvokeOnMainThreadAsync<T>(Func<Task<T>>)

Invokes a Func on the device main (UI) thread.

public static System.Threading.Tasks.Task<T> InvokeOnMainThreadAsync<T> (Func<System.Threading.Tasks.Task<T>> funcTask);
static member InvokeOnMainThreadAsync : Func<System.Threading.Tasks.Task<'T>> -> System.Threading.Tasks.Task<'T>

Type Parameters

T

The return type of the Func.

Parameters

funcTask
System.Func<System.Threading.Tasks.Task<T>>

The Func to invoke.

Returns

System.Threading.Tasks.Task<T>

Applies to