I am currently trying to add additional functionality onto an existing application, and have started using MvvmCross for the new screens, therefore I have a hybrid app on my hand right now. I want to navigate from an old screen to a new screen using ViewModel, and passing an object in memory as well. I've followed the suggestions from here:
Using Notifications on android with MvvmCross
Here is my code:
var viewModelRequest = MvxViewModelRequest<MyViewModel>.GetDefaultRequest ( );
viewModelRequest.ParameterValues = new Dictionary<string, string> ( );
viewModelRequest.ParameterValues.Add ( "myobject", JsonConvert.SerializeObject ( this.myObject, Formatting.None ) );
var intent = Mvx.Resolve<IMvxAndroidViewModelRequestTranslator>().GetIntentFor ( viewModelRequest );
this.StartActivity ( intent );
When I run this code, it throws a null object exception at the point where it tries to solve the IMvxAndroidViewModelRequestTranslator. I took a quick look at the mvvmcross code, and notice that the InitializeSecondary() (where InitializeViewsContainer() is called) is only called in the InitialieFromSplashScreen() method. My question is, is it because my splash screen did not inherit from MvxSplashScrennActivity, that my viewcontainers are not initialized properly? If that is the case, can I do this intialization somewhere manually?