Control Navigation
If you need to move between pages, you can use links to move between them but in Windows Phone 7 you need to take care of the Back button that every phone has. One way to do that is overriding the OnBackKeyPress event with something like this:
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
//Call a function in your script that evals if you need to move back.
widget.InvokeScript("eval", new string[] { "yourWidget.backHistory()" });
if (manageWidget == 2)
base.OnBackKeyPress(e);
else
e.Cancel = true;
}
yourWidget.backHistory() = function(){
if ( somethingToEvaluateToKnowWhereToGo ){
//Move to previous page
window.external.Notify("Back()");
} else{
//End the execution of the app
window.external.Notify("HistoryBackEnd()");
}
}