Setting the ViewModel on Navigation Pages

Oct 2, 2010 at 2:23 AM

I am trying to use CM with a SL Navigation Application.

I created the bootstrapper and it binds the MainPageViewModel just fine.  However, all other pages have end up with the same ViewModel.

How am I supposed to bind the ViewModel for the other pages? 

I have searched through the docs and discussions and can't find anything on this. 



Oct 2, 2010 at 3:55 AM

Have a look at how the WP7 version of the framework works. In particular, you may want to borrow the FrameAdapter for use in Silverlight.

Oct 2, 2010 at 11:34 AM

Thanks very much.  A HelloNav sample along these lines would be great - I am still learning MEF and Caliburn and there a bit too many moving parts for me to put it together.

But I did find ViewModelBinder.Bind which lets me programatically bind the view and model and get the benefits of Caliburn and automatic binding.

Oct 2, 2010 at 1:13 PM

Read through this article on WP7 development

Then, you can go grab the source code for the PhoneAdapter and plug it into your Silverlight application in the same way as it was used in WP7.