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
| Name | Description |
|---|---|
| InvokeOnMainThreadAsync(Func<Task>) |
Obsolete.
Invokes an async task-returning function on the main thread. |
| InvokeOnMainThreadAsync(Action) |
Obsolete.
Invokes an action on the main thread asynchronously. |
| InvokeOnMainThreadAsync<T>(Func<Task<T>>) |
Obsolete.
Invokes an async task-returning function on the main thread and returns the result. |
| InvokeOnMainThreadAsync<T>(Func<T>) |
Obsolete.
Invokes an async function on the main thread and returns the result. |
InvokeOnMainThreadAsync(Func<Task>)
- Source:
- Device.cs
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes an async task-returning function on the main thread.
public:
static System::Threading::Tasks::Task ^ InvokeOnMainThreadAsync(Func<System::Threading::Tasks::Task ^> ^ funcTask);
[System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")]
public static System.Threading.Tasks.Task InvokeOnMainThreadAsync(Func<System.Threading.Tasks.Task> funcTask);
[<System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")>]
static member InvokeOnMainThreadAsync : Func<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task
Public Shared Function InvokeOnMainThreadAsync (funcTask As Func(Of Task)) As Task
Parameters
Returns
A task representing the async operation.
- Attributes
Applies to
InvokeOnMainThreadAsync(Action)
- Source:
- Device.cs
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes an action on the main thread asynchronously.
public:
static System::Threading::Tasks::Task ^ InvokeOnMainThreadAsync(Action ^ action);
[System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")]
public static System.Threading.Tasks.Task InvokeOnMainThreadAsync(Action action);
[<System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")>]
static member InvokeOnMainThreadAsync : Action -> System.Threading.Tasks.Task
Public Shared Function InvokeOnMainThreadAsync (action As Action) As Task
Parameters
- action
- Action
The action to invoke.
Returns
A task representing the async operation.
- Attributes
Applies to
InvokeOnMainThreadAsync<T>(Func<Task<T>>)
- Source:
- Device.cs
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes an async task-returning function on the main thread and returns the result.
public:
generic <typename T>
static System::Threading::Tasks::Task<T> ^ InvokeOnMainThreadAsync(Func<System::Threading::Tasks::Task<T> ^> ^ funcTask);
[System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")]
public static System.Threading.Tasks.Task<T> InvokeOnMainThreadAsync<T>(Func<System.Threading.Tasks.Task<T>> funcTask);
[<System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")>]
static member InvokeOnMainThreadAsync : Func<System.Threading.Tasks.Task<'T>> -> System.Threading.Tasks.Task<'T>
Public Shared Function InvokeOnMainThreadAsync(Of T) (funcTask As Func(Of Task(Of T))) As Task(Of T)
Type Parameters
- T
The return type of the task.
Parameters
Returns
A task containing the result of the async function.
- Attributes
Applies to
InvokeOnMainThreadAsync<T>(Func<T>)
- Source:
- Device.cs
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes an async function on the main thread and returns the result.
public:
generic <typename T>
static System::Threading::Tasks::Task<T> ^ InvokeOnMainThreadAsync(Func<T> ^ func);
[System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")]
public static System.Threading.Tasks.Task<T> InvokeOnMainThreadAsync<T>(Func<T> func);
[<System.Obsolete("Use BindableObject.Dispatcher.DispatchAsync() instead.")>]
static member InvokeOnMainThreadAsync : Func<'T> -> System.Threading.Tasks.Task<'T>
Public Shared Function InvokeOnMainThreadAsync(Of T) (func As Func(Of T)) As Task(Of T)
Type Parameters
- T
The return type of the function.
Parameters
- func
- Func<T>
The function to invoke.
Returns
A task containing the result of the function.
- Attributes