Skip to main content
 首页 » 编程设计

c#之如何在 WPF 应用程序中的任何位置获取调度程序

2024年02月13日13bonelee

我想获取 WPF 应用程序中的当前调度程序。我想要获取调度程序的代码在 .cs 类文件(常规 C# 类)中。 Application.Current.Dispatcher.Invoke() 和其他 ....Current.Dispatcher.Invoke() 不可用。

有什么办法吗?

请您参考如下方法:

为什么类 Application.Current.Dispatcher 不可用?您是否已引用 PresentationFramework 程序集?