3
votes

I created a Content Page named MainList.xaml. Now my main page isn't a navigation page since it deals with setting the App up but I want MainList.xaml to be a navigation page. The problem is, when I try:

MainList mainListPage = new NavigationPage(new MainList());

I get the error:

Cannot implicitly convert type 'Xamarin.Forms.NavigationPage' to 'SalApp.views.MainList'

How would I go about converting it into a navigation page? There doesn't seem to be an option to even create a navigation page. In the App.xaml file, I can make MainPage.xaml a navigation page but I don't know why MainList doesn't have the same privilige.

1

1 Answers

4
votes

you're creating an instance of NavigationPage that wraps MainList, to the type returned will be a NavigationPage

NavigationPage navPage = new NavigationPage(new MainList());