I am trying to call System.Windows.Threading.Dispatcher.BeginInvoke . The signature of the method is as follows:
BeginInvoke(Delegate method, params object[] args)
I am trying to pass Lambda to it instead of creating a delegate.
_dispatcher.BeginInvoke((sender) => { DoSomething(); }, new object[] { this } );
This gives me a compiler error saying that I cannot convert lambda to System.Delegate. The delegate signature accepts the object as a parameter and returns void. My lambda matches this, but it doesn't work. What am I missing?
c # lambda begininvoke wpf dispatcher
Micah Feb 08 2018-11-18T00: 00Z
source share