0

I has a Windows Phone 8.1 Silverlight app where I was accessing UI thread elements from a background thread using this syntax:

Dispatcher.BeginInvoke(() =>
{
        //access UI thread elements here
});

and it worked just fine. Then I decided to remake the entire project in Runtime since I needed some of its features and now this syntax doesn't compile and gives the error:

'Windows.UI.Core.CoreDispatcher' does not contain a definition for 'BeginInvoke' and no extension method 'BeginInvoke' accepting a first argument of type 'Windows.UI.Core.CoreDispatcher' could be found (are you missing a using directive or an assembly reference?)

Any help?

Ali250
  • 652
  • 1
  • 5
  • 19
  • 2
    Try [CoreDispatcher.RunAsync](http://msdn.microsoft.com/en-us/library/ie/windows.ui.core.coredispatcher.runasync) – Sriram Sakthivel Dec 17 '14 at 19:18
  • 1
    Indeed - basically, when in doubt, read the documentation for the type which is causing you problems. This applies to a whole range of issues. In this case, the documentation is http://msdn.microsoft.com/en-us/library/ie/windows.ui.core.coredispatcher – Jon Skeet Dec 17 '14 at 19:19

0 Answers0