Search code examples
c#xamlsecuritywindows-phone-7windows-phone-8

Stopping the User From Accessing The Application When Using the Back Button


I am making a simple password managing application, which requires the user to remember one 'Master Password' to access all his/her other passwords stored on the application.

However my problem is the back button (and multitasking). As if the user (or more importantly, other person) uses these, he/she can access the app without having to go past the initial verification page.

Is there any way to deter this problem?

Or is there a way to simply kill the application when the start button is pressed? (to achieve the same effect as when you exit an app using the back button).


Solution

  • If your application targets Windows Phone 7 (which will run on Phone 8) you can exit an app with the following line:

    new Microsoft.Xna.Framework.Game().Exit();
    

    This is found in the Microsoft.Xna.Framework.Game assembly.