Device.InvokeOnMainThreadAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
InvokeOnMainThreadAsync(Action) |
在设备主 (UI) 线程上调用操作。 |
InvokeOnMainThreadAsync(Func<Task>) |
在设备主 (UI) 线程上调用函数。 |
InvokeOnMainThreadAsync<T>(Func<T>) |
在设备主 (UI) 线程上调用函数。 |
InvokeOnMainThreadAsync<T>(Func<Task<T>>) |
在设备主 (UI) 线程上调用函数。 |
InvokeOnMainThreadAsync(Action)
在设备主 (UI) 线程上调用操作。
public static System.Threading.Tasks.Task InvokeOnMainThreadAsync (Action action);
static member InvokeOnMainThreadAsync : Action -> System.Threading.Tasks.Task
参数
- action
- System.Action
要调用的操作
返回
System.Threading.Tasks.Task
适用于
InvokeOnMainThreadAsync(Func<Task>)
在设备主 (UI) 线程上调用函数。
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
参数
- funcTask
- System.Func<System.Threading.Tasks.Task>
要调用的函数。
返回
System.Threading.Tasks.Task
适用于
InvokeOnMainThreadAsync<T>(Func<T>)
在设备主 (UI) 线程上调用函数。
public static System.Threading.Tasks.Task<T> InvokeOnMainThreadAsync<T> (Func<T> func);
static member InvokeOnMainThreadAsync : Func<'T> -> System.Threading.Tasks.Task<'T>
类型参数
- T
Func 的返回类型。
参数
- func
- System.Func<T>
要调用的函数。
返回
System.Threading.Tasks.Task<T>
适用于
InvokeOnMainThreadAsync<T>(Func<Task<T>>)
在设备主 (UI) 线程上调用函数。
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>
类型参数
- T
Func 的返回类型。
参数
- funcTask
- System.Func<System.Threading.Tasks.Task<T>>
要调用的函数。
返回
System.Threading.Tasks.Task<T>