共用方式為


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。

適用於

另請參閱