I am making an app in wp8.1 I want to make sure that during certain process user is not allowed to press the hardware backbutton of windows phone. IF he does then my custom catch block exception should run.
I don't know how to handle the backbutton exception for my app. Please provide any snippet or help you can in making custom exception.
Thanks
public class InvalidDataException : ApplicationException
{
public InvalidDataException()
{
}
public InvalidDataException(string msg)
: base(msg)
{
}
}
If you set BackPressedEventArgs (e) parameter's Handled property to True , you will block the OS action on this event you can trigger your custom exception.
When you set this property to true OS will stop to navigate back.However , you shouldn't prevent user from terminating your app.Otherwise your app has a change to not get into the Store.