C# WPF任务调度器。调度到FromCurrentSynchronizationContext时是否存在DispatcherPriority?
对于下面的代码,当MethodRunUnuithRead被调度时,是否存在DispatcherPriority?我想这可能是正常的,但不确定如何确认。或者,一旦GUI线程可用,ContinueWith块实际上会等待并立即执行C# WPF任务调度器。调度到FromCurrentSynchronizationContext时是否存在DispatcherPriority?,c#,wpf,C#,Wpf,对于下面的代码,当MethodRunUnuithRead被调度时,是否存在DispatcherPriority?我想这可能是正常的,但不确定如何确认。或者,一旦GUI线程可用,ContinueWith块实际上会等待并立即执行 Task.Factory .StartNew(() => BackgroundMethodCall()) .ContinueWith(t => MethodRunOnUIThread() , TaskScheduler.FromC
Task.Factory
.StartNew(() => BackgroundMethodCall())
.ContinueWith(t => MethodRunOnUIThread()
, TaskScheduler.FromCurrentSynchronizationContext()
);
我想这可能是正常的,但不确定如何确认
根据报告:
委托以正常优先级放入调度程序队列
ContinueWith使用给定的任务计划程序以连续方式继续任务。对于TaskScheduler.FromCurrentSynchronizationContext,它将委托发布到同步上下文。它不会阻止并等待UI线程的可用性。God~~我搜索了DispatcherPriority和TaskScheudler,但找不到任何东西。不知道答案是在FromCurrentSynchronizationContext。天哪。。。