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(Func<Task>) |
Obsolete.
Invokes a Func on the device main (UI) thread. |
InvokeOnMainThreadAsync(Action) |
Obsolete.
Invokes an Action on the device main (UI) thread. |
InvokeOnMainThreadAsync<T>(Func<Task<T>>) |
Obsolete.
Invokes a Func on the device main (UI) thread. |
InvokeOnMainThreadAsync<T>(Func<T>) |
Obsolete.
Invokes a Func on the device main (UI) thread. |
InvokeOnMainThreadAsync(Func<Task>)
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes a Func on the device main (UI) 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
- Attributes
Applies to
InvokeOnMainThreadAsync(Action)
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes an Action on the device main (UI) thread.
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
- Attributes
Applies to
InvokeOnMainThreadAsync<T>(Func<Task<T>>)
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes a Func on the device main (UI) thread.
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 Func.
Parameters
Returns
- Attributes
Applies to
InvokeOnMainThreadAsync<T>(Func<T>)
- Source:
- Device.cs
- Source:
- Device.cs
Caution
Use BindableObject.Dispatcher.DispatchAsync() instead.
Invokes a Func on the device main (UI) thread.
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 Func.
Parameters
- func
- Func<T>
The Func to invoke.
Returns
- Attributes
Applies to
.NET MAUI