I am working on a WPF application in VS2008 and decided to reuse some code from another WPF application. However I have a strange issue with the following line:
Message.Dispatcher.Invoke(() => { Message.Text = "Looking for orders..."; });
This code works fine in the original application but throws the normal "Cannot convert lambda expression to type 'System.Delegate' because it is not a delegate type" error in the new application.
I know I can cast the expression as an Action to get it to work; but I am curious as to why the same piece of code compiles and works in one project but not another.