New to Xamarin.Forms question.. I'm trying to piece together some navigation for my View Models. I have an Application ViewModel which has a Navigate method that fires an event OnViewModelChanged, passing the View Model to navigate to. All good, working well in Windows.
However on Android, I've created an AppNavigation class to handle the event, create the view, bind the viewmodel, then do the await MainPage.Navigation.PushAsync(page); - the code runs through, but after the page is navigated to a very unhelpful error message is shown: "Unhandled Exception: System.InvalidCastException: Specified cast is not valid."
The initial page is shown, using the same mechanism, with out a problem (but this is not triggered through one of the view models) and I've tried various views as the initial page and they all load fine - but every time I navigate to the second page I get the error.
Anything I'm doing wrong? Is this the right approach? Any suggestion on how to debug further?