什么时候添加了System.Windows.Threading.Dispatcher.Invoke(System.Delegate,System.Object [])?

时间:2009-06-22 05:40:34

标签: c# .net wpf

有些人使用我的应用程序似乎正在

System.MissingMethodException: Method not found: 
'System.Object System.Windows.Threading.Dispatcher.Invoke
    (System.Delegate, System.Object[])'

有谁知道在这个版本的框架中添加了这个重载,是否可以安全使用?(未标记为已弃用)。

2 个答案:

答案 0 :(得分:6)

以下方法在3.5 SP1上添加到Dispatcher类

BeginInvoke(Delegate, array[]()[]), 
BeginInvoke(Delegate, DispatcherPriority, array[]()[]), 
Invoke(Delegate, array[]()[]), 
Invoke(Delegate, TimeSpan, array[]()[]), 
Invoke(Delegate, TimeSpan, DispatcherPriority, array[]()[]), 
Invoke(Delegate, DispatcherPriority, array[]()[])

请查看以下链接:MSDN-Dispatcher-Class

答案 1 :(得分:0)

得到它......太烦人了。

只需使用:

Dispatcher.Invoke(DispatcherPriority.Normal, ...[REST OF PARAMS]);

此过载不会出现在IntelliSense中,但它可以完美地编译并适用于3.5和3.5SP1

PROFIT !!