共用方式為


DispatcherExtensions.WithPriority 方法

定義

建立排 JoinableTaskFactory 程使用指定 DispatcherDispatcherPriority的 。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Threading::JoinableTaskFactory ^ WithPriority(Microsoft::VisualStudio::Threading::JoinableTaskFactory ^ joinableTaskFactory, System::Windows::Threading::Dispatcher ^ dispatcher, System::Windows::Threading::DispatcherPriority priority);
public static Microsoft.VisualStudio.Threading.JoinableTaskFactory WithPriority (this Microsoft.VisualStudio.Threading.JoinableTaskFactory joinableTaskFactory, System.Windows.Threading.Dispatcher dispatcher, System.Windows.Threading.DispatcherPriority priority);
static member WithPriority : Microsoft.VisualStudio.Threading.JoinableTaskFactory * System.Windows.Threading.Dispatcher * System.Windows.Threading.DispatcherPriority -> Microsoft.VisualStudio.Threading.JoinableTaskFactory
<Extension()>
Public Function WithPriority (joinableTaskFactory As JoinableTaskFactory, dispatcher As Dispatcher, priority As DispatcherPriority) As JoinableTaskFactory

參數

joinableTaskFactory
JoinableTaskFactory

要使用的基礎 JoinableTaskFactory

dispatcher
Dispatcher

Dispatcher 程在主線程上工作的 。

priority
DispatcherPriority

排程 UI 線程上任何工作的優先順序,在呼叫 和 時,以及 SwitchToMainThreadAsync(CancellationToken) 針對在 之後 await的每個異步傳回主線程時和 。

傳回

JoinableTaskFactory 可用於排程具有指定優先權的異步工作。

適用於