CoreDispatcher.TryRunAsync(CoreDispatcherPriority, DispatchedHandler) 方法

定义

尝试从工作线程在 UI 线程上计划指定的回调,并异步返回结果。

public:
 virtual IAsyncOperation<bool> ^ TryRunAsync(CoreDispatcherPriority priority, DispatchedHandler ^ agileCallback) = TryRunAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> TryRunAsync(CoreDispatcherPriority const& priority, DispatchedHandler const& agileCallback);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> TryRunAsync(CoreDispatcherPriority priority, DispatchedHandler agileCallback);
function tryRunAsync(priority, agileCallback)
Public Function TryRunAsync (priority As CoreDispatcherPriority, agileCallback As DispatchedHandler) As IAsyncOperation(Of Boolean)

参数

priority
CoreDispatcherPriority

指定事件调度的优先级。 将此设置为 CoreDispatcherPriority.Normal

agileCallback
DispatchedHandler

调度事件时调度程序返回的回调。

返回

异步操作。

属性

注解

如果在关闭 CoreDispatcher 时调用此方法,此方法将成功完成并返回 false。

适用于

另请参阅