我正在为 Windows Phone 8 开发一个小应用程序,它有 2 个页面(1 个当然是主页)。
到达第 2 页时,我想通过按手机上的后退按钮来检查是否已到达此页面。我想做这样的事情:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
if (backButton.isPressed()) {
// this page has been reached by pressing the back button on the phone
} else {
// this page has been reached by NavigationService.Navigate()
}
}
是否有本地 API 可以做到这一点?