I was looking around for refrences using dispatcher to call code on the UI thread and they say to do this:
Dispatcher.BeginInvoke(() => {OnSendSuccessful(); });
But I get a compiler error saying I cant access non-static method BeginInvoke in a static context. Any ideas? I tried to new up a dispatcher but that doesn't even make sense.
Try using:
Deployment.Current.Dispatcher.BeginInvoke(() => {OnSendSuccessful(); });
This uses a static method to get a dispatcher for use in a static context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With