Device.InvokeOnMainThreadAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
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
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.