Jul 30, 2010 at 3:59 AM
Edited Jul 30, 2010 at 4:05 AM
Those sound like reasonable steps to me. Here's some thoughts:
1. Yes. The ViewModelBinder can be used completely independently of anything else. So, this is a good first step.
2. Unfortunately, I don't think VB has iterators yet. So, that makes the co-routine technique a C# only thing for the moment.
3. I'm working on some pieces to improve the situation with WP7. I haven't checked in my work yet. When I do, you should take a look at it. There are some pieces related to navigation and screens. You may be able to adapt it. Perhaps I will make some of
it available in the SL version. I don't know yet. Right now I'm trying to get WP7 working well...then I'll look at migrating it back to the SL4 version.
Here's a snippet from what I'm working on:
public class PhoneApplicationFrameAdapter : INavigationService
readonly PhoneApplicationFrame frame;
public PhoneApplicationFrameAdapter(PhoneApplicationFrame frame)
this.frame = frame;
frame.Navigating += OnNavigating;
frame.Navigated += OnNavigated;
void OnNavigating(object s, NavigatingCancelEventArgs e)
var fe = frame.Content as FrameworkElement;
if (fe == null)
var deactivator = fe.DataContext as IDeactivate;
if (deactivator != null)
void OnNavigated(object s, NavigationEventArgs e)
var viewModel = ViewModelLocator.LocateForViewType(e.Content.GetType());
ViewModelBinder.Bind(viewModel, (DependencyObject)e.Content, null);
//TODO: IHaveSubject check?
var activator = viewModel as IActivate;
if(activator != null)
You can wire to the navigation events and then use a ViewModelLocator to find the VM and the ViewModelBinder to put it together with the view. There's no ViewModelLocator in Caliburn yet, but it does the opposite of the ViewLocator. By adding these event
handlers, you transform the navigation service into a little more of a ScreenConductor. Anyways, I hope that gives you some ideas. You'll probably see this in the framework very soon.