Getting started ... probably missing something fundamental

Feb 14, 2015 at 5:32 AM
Hi,

Just getting started with this library (and pubsubevents) and having issues. I am building a universal app and following along with the Adventureworks reference app. However, I keep running into the same issue when navigating between pages. I am deriving the app class from MvvmAppBase and the pages from VisualStateAwarePage class. I am using a unity container to create my objects (MvvmAppBase.Resolve overridden) and registering the MvvmAppBase.NavigationService as the INavigationService and injecting it into view models.

So I create a couple of pages with view models and set them up in the ViewModelLocationProvider delegate to resolve the viewmodel based on the view type. When the application starts, the main page has a button to go the the secondary page and the secondary page has a button to go back to the main page. In each case a DelegateCommand is used to execute INavigation.Navigate("Page", null) to go back and forth. Navigating from the main page using the button brings up the secondary page. If I use the hardware back button (phone) I get a key is null error on a dictionary. If I use the button and the underlying DelegateCommand.Execute with the INavigationService to go to Navigate("Main", null) I get a catastrophic error on a dictionary.

I'm feeling dumb and that I am missing something very obvious. Can anybody give me any suggestions on what to look out for??

Thanks so much,
Mike

I have tried verifying my app vs. the nuget packages in the AW reference app, tried to make the prism projects part of my solution and still have the same problem. Everytime I navigate, I get a dictionary error where the key is null.

I feel like I am missing something really fundamental and I can't seem to grasp what the issue is.
Feb 14, 2015 at 5:35 PM
I found something now, when I overload the VisualStateAwarePage.OnNavigatedFrom to not call the base function and now I seem to be able to go back and forth. Looking at the source for VisualStateAwarePage it looks like it is trying to save state. I guess I will be learning more about that stuff when I get to that point !