0
我将需要以下VB窗体代码转换为WPF C#参数:不能通过在dispatcher.invoke
// VB
Me.Invoke(New FooDelegate(AddressOf Foo), New Object() {cmd})
哪里Foo
只是采取一个字符串参数cmd
的方法。
我尝试了所有的遵循WPF C#,但所有给我的异常:
//C#
dispatcher.Invoke(new FooDelegate(Foo()), cmd);
dispatcher.Invoke(new FooDelegate(Foo(cmd)), cmd);
dispatcher.Invoke(new FooDelegate(Foo()), new object() {cmd});
什么是正确的格式?