AccessViolationException thrown on Navigate to Xamarin Forms Page

Viewed 565

I am trying to Navigate to a Xamarin Forms NavigationPage. However I am trying to do it after the Frame has been first loaded up with some "native" UWP pages.

this.rootFrame.Navigate(page.GetType(), param);

This code results in a AccessViolationException. The page object is a Xamarin.Forms.Page but I have also tried it with a NavigationPage(page) wrapper.

I realise that normal XF navigation is done with Navigation.PushAsync etc but I am at a point where the XF application and navigation infrastructure as not yet been initialised.

This is how I create my initial NavigationPage

XFormsApp.MainPage = new NavigationPage(contentPage);

var converter = Mvx.Resolve<IMvxNavigationSerializer>();
var requestText = converter.Serializer.SerializeObject(request);

_rootFrame.Navigate(mainPage.GetType(), requestText);

I am trying to create a hybrid UWP app that starts with Native Pages and later launches some XF Pages. The official Xamarin Forms samples have an example of this for iOS and Android

1 Answers
Related