[英]Why am I losing the navigation back entry when I navigate from one of the pages to another page in my application?
I have two pages: Page1.xaml and Page2.xaml. 我有两个页面:Page1.xaml和Page2.xaml。 Page1.xaml has a listbox in which, when a user selects an item, I do a
NavigationService.Navigate(new Uri("/Page2.xaml", UriKind.Relative));
Page1.xaml有一个列表框,当用户选择一个项目时,我在其中做
NavigationService.Navigate(new Uri("/Page2.xaml", UriKind.Relative));
. 。
But from Page2.xaml, when I press the hardware Back button, it simply exits the application. 但是从Page2.xaml中,当我按下硬件“后退”按钮时,它只是退出了应用程序。 Page1.xaml is the startup page of the application.
Page1.xaml是应用程序的启动页面。
There was an exception when I pressed the Back button on the second page, which was causing the application to close. 当我按下第二页上的“后退”按钮时,出现了一个异常,这导致应用程序关闭。 I never debugged this part and hence never realized.
我从未调试过这一部分,因此从未意识到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.