I will need to convert the following VB Form code to WPF C#:
// VB
Me.Invoke(New FooDelegate(AddressOf Foo), New Object() {cmd})
Where Foo is just a method taking a string argument cmd.
I tried all the following in WPF C#, but all giving me exception:
//C#
dispatcher.Invoke(new FooDelegate(Foo()), cmd);
dispatcher.Invoke(new FooDelegate(Foo(cmd)), cmd);
dispatcher.Invoke(new FooDelegate(Foo()), new object() {cmd});
What is the correct formatting?
You are calling function with
()instead of geting its address. Unless ProcessCommandCT returns function it should be something like: