简体   繁体   中英

Navigation on Windows Phone with Xamarin.Forms

I am using Xamarin.Forms to write a cross platform app.

To change between Pages I am using Navigation.PushAsync(new Page()); . This works fine when there is a NavigationPage .

Now I want to get rid of the NavigationPage on Windows Phone 8.1, because it is destroying my layout.

The Xamarin.Forms guides note, that you do not need a NavigationPage on Windows Phone.

Also note that the Windows Phone platform provides navigation natively. Therefore, you do not need to use a NavigationPage object to get navigation on that platform.

Bu when I do not use a NavigationPage, an Exception will be thrown.

在此处输入图片说明

So what can I do to use Navigation without NavigationPage on Windows Phone?

You can use PushModalAsync if it is disturbing your layout. I don't why such a statement in Xamarin site, because all navigations are handled by adding a navigation page.

https://developer.xamarin.com/api/member/Xamarin.Forms.INavigation.PushModalAsync/p/Xamarin.Forms.Page/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM