简体   繁体   English

从应用程序中的一个页面导航到另一个页面时,为什么会丢失导航返回条目?

[英]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.

相关问题 我的 AdMob 广告仅在我导航到另一个页面然后返回时才加载 - My AdMob Ad only loading up when I navigate to another page then back 从另一个页面返回时如何导航到特定的中心Windows Phone 8.1 - How can I navigate to a specific hub when I come back from another page Windows Phone 8.1 为什么我的 Socket InputStream 会丢失字节? - Why am I losing bytes from my Socket InputStream? 为什么从双精度到十进制会丢失数据 - why am i losing data when going from double to decimal 两帧导航(第二个导航页面时,第一个添加条目) - two frame navigation (first one add entry when second one navigate a page) 当我导航到ASP.Net应用程序时发生了两次导航,为什么会发生这种情况? - Two navigation occurred when I navigate to ASP.Net application, any idea why that happens? 为什么在使用ReceiveAndDelete时丢失消息? - Why am I losing messages when I use ReceiveAndDelete? 从一个数据网格浏览到不同页面上的另一个 - Navigate from one datagrid to another on different pages 当我从控制台应用程序打开它时,为什么我的 Windows 窗体布局会发生变化? - Why does my Windows-Forms Layout change, when I am opening it from a Console-Application? 在另一个项目中使用NuGet包时,为什么会出现XamlParseException? - Why am I getting a XamlParseException when using my NuGet package from another project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM