WP7 - How to Dispatch to UI thread

Oct 23, 2010 at 4:36 AM

I'm writing a WP7 app. I have A VM inherited from Screen. 

I'm trying to call some code that needs to run on the UI thread. Pre-Caliburn I would wrap the code in a Dispatcher.BeginInvoke.

What is the CM way of doing this?

I have read the docs but am confused - should I use an Action, grab the view somehow, something else ?

Cheers

Steve

Oct 23, 2010 at 9:12 AM
Edited Oct 23, 2010 at 9:17 AM
You can directly call:
Caliburn.Micro.Execute.OnUIThread(theActionDelegate)
which in turns calls Dispatcher.
Note that, in some scenarios, CM already take this into account.

Oct 23, 2010 at 9:42 PM

Works a treat. Thanks Marco.