Invoking WPF Dispatcher with anonymous method?

Look at the signature for Dispatcher.Invoke() . It doesn't take Action or some other specific delegate type. It takes Delegate which is the common ancestor of all delegate types.

But you can't convert anonymous method to this base type directly, you can convert it only to some specific delegate type. (The same applies to lambdas and method groups.).

The 'Delegate' class is abstract so you have to provide the compiler with a type that is derived from it. Any class derived from Delegate will do but Action is usually the most appropriate one.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions