I was developing my application for UWP, and today, when I launched the application, I found that pressing the button back on the phone or emulator simply collapses the application. Previously, she returned me back to the page with which I switched using the Frame.Navigate method, and now it just turns off. Only this construction helped: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d51f4cb4-d686-4d30-8820-ccbae4326450/uwpwindows10-mobile-back-button?forum=wpdevelop But even it works crookedly, it flips back one page more. Can anyone explain what happened? ZY In my other projects, everything works.

  • one
    Show the code for these two pages (just for navigation). - andreycha
  • @andreycha pastebin.com/SsVXAVsc - Horoko
  • show subscription code BackPressed? - Andrii Krupka
  • @Andrii Krupka I have never signed or signed this event. From the very beginning, as soon as I created the application in VS2015, I did not touch anything related to the navigation of the Back button. And at the same time, everything worked and suited me. That after moving to any page above by the written method, I can press the Back button at any time, and return to the previous page. - Horoko
  • @AndriiKrupka I created a new project and the same there. I could not even see that the button back I return to the previous page. I have video recordings where I filmed the application process, and so there I calmly go back using the back button. At the same time, I did not write anything in the code about this. - Horoko

1 answer 1

Most likely you are confusing UWP applications and universal applications based on Windows 8.1. The fact is that in 8.1 the subscription to BackPressed and the corresponding behavior were already protected in the logic of the classes included in the project template. UWP applications do not have a ready-made template for a given case, which means you will have to implement the navigation logic yourself. There is a good article about it and an interesting example of the implementation of navigation in the UWP application.