What I’m building is essentially a single page search application with text field and a list of results. Since this application will consist of only one page, tapping hardware back button on phone will kill my app and take user to the Start app.
I think it would provide a much better expirience for users if I could somehow override this standard behavior in a way that pressing back would take user to a previous successfull search results on this very same page (if there are any, otherwise quit an app as normal back would do).
Question is if it’s possible to override back navigation in this way and if yes then how?
You can catch the hardware back key press by overriding the
OnBackKeyPressmethod in your page. You can detect cases where you want to perform an internal action rather than exit a page.This is documented on MSDN here.
Be careful to make sure you don’t break exiting the application with the back key however, or else your application could fail Marketplace certification.