Windows Phone 8后退按钮事件(OnBackKeyPress)处理?

gay*_*991 1 c# windows-phone-8

是否可以通过其他方法制作Windows Phone 8后退按钮事件(OnBackKeyPress)?我一直试图从外部按钮点击或页面初始化程序调用该事件.但它出错了?

OnBackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(OnBackKeyPress);
Run Code Online (Sandbox Code Playgroud)

'OnBackKeyPress'没有重载匹配委托'System.EventHandler'

小智 8

只需覆盖下面的后退按键事件,

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
   //Do your work here
   base.OnBackKeyPress(e);
}
Run Code Online (Sandbox Code Playgroud)