Navigation Parameters

Sep 11, 2012 at 3:02 PM
Edited Sep 11, 2012 at 3:05 PM

I have never done W7 apps before and I am in the process of upgrading my wpf application to winrt. I have modified your INavigationService to allow for passing in the datacontext. Then on the NavigateTo method of the LayoutAware page I attached the datacontext. The problem is I get an error WinRT information: GetNavigationState doesn't support serialization of a parameter type which was passed to Frame.Navigate.

This error is the datacontext. What would be the appropriate method to serialize this correctly to allow it to be passed? I have seen a lot of forum posts with this issue but none that resolve it. 

 

Setting the class as a DataContract hasn't worked.

Coordinator
Sep 11, 2012 at 3:31 PM
Edited Sep 12, 2012 at 9:40 AM
I pass params to the destination view model using the messageSender and pick up at the other end with MessageReceiver (it's in the sample). You can always poke things into the dest vm through the ViewModelLocator if you're using mvvm light.