This is a mirror of official site: http://jasper-net.blogspot.com/

Development Tip – Dispatching calls to the UI thread

| Wednesday, October 5, 2011
In Silverlight and WPF, if you wanted to update the UI from a thread you had launched, it was important that the UI update be executed on the UI thread, lest you get an invalid-cross-thread-access error.

You could ensure this by initially getting a pointer to the dispatcher for the UI thread, and then asking it to run your code. Something like this:

_OriginalDispatcher = Application.Current.RootVisual.Dispatcher;

_OriginalDispatcher.BeginInvoke(myAction);


Read more: Yet Another Coding Blog
QR: windows-8-development-tip-dispatching-calls-to-the-ui-thread.aspx

Posted via email from Jasper-net

0 comments: