MainThread.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) |
Invoke the main thread async |
InvokeOnMainThreadAsync(Func<Task>) |
Invoke the main thread async |
InvokeOnMainThreadAsync<T>(Func<Task<T>>) |
Invoke the main thread async |
InvokeOnMainThreadAsync<T>(Func<T>) |
Invoke the main thread async |
InvokeOnMainThreadAsync(Action)
Invoke the main thread async
public static System.Threading.Tasks.Task InvokeOnMainThreadAsync (Action action);
Parameters
- action
- System.Action
Action to invoke
Returns
A task that can be awaited
Applies to
InvokeOnMainThreadAsync(Func<Task>)
Invoke the main thread async
public static System.Threading.Tasks.Task InvokeOnMainThreadAsync (Func<System.Threading.Tasks.Task> funcTask);
Parameters
- funcTask
- System.Func<System.Threading.Tasks.Task>
A function task to execute
Returns
A task that can be awaited
Applies to
InvokeOnMainThreadAsync<T>(Func<Task<T>>)
Invoke the main thread async
public static System.Threading.Tasks.Task<T> InvokeOnMainThreadAsync<T> (Func<System.Threading.Tasks.Task<T>> funcTask);
Type Parameters
- T
Parameters
- funcTask
- System.Func<System.Threading.Tasks.Task<T>>
A function task to execute
Returns
A task that can be awaited
Applies to
InvokeOnMainThreadAsync<T>(Func<T>)
Invoke the main thread async
public static System.Threading.Tasks.Task<T> InvokeOnMainThreadAsync<T> (Func<T> func);
Type Parameters
- T
Parameters
- func
- System.Func<T>
A function to execute
Returns
A task that can be awaited