就是我写了一个wp8的项目,
有增删该查,点击添加是跳向另外一个页面,添加成功后再次回到主页,但是当我后退的时候,它会先后退到添加页面,再后退到主页,然后才退出程序,请问这个我要怎么处理啊?还有就是它那个后退的事件,我可以在哪里控制啊?------解决方案--------------------
官方有SDK文档的,去查一下吧
------解决方案--------------------
在构造函数中写下:
this.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(MainPage_BackKeyPress);
下面是方法:
void MainPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
{
int count = NavigationService.BackStack.Count();
if (count > 0)
{
for (int i = 0; i < count; i++)
{
NavigationService.RemoveBackEntry();
}
}
}