繁体   English   中英

Windows Phone上的Interupt后退按钮

[英]Interupt back button on windows phone

当用户离开我的页面,然后使用“后退”按钮返回到该页面时,我希望他们被重定向到其他页面,有没有办法做到这一点?

是的,通过快速的Google搜索或StackOverflow搜索,您会找到它。 但是,由于我心情愉快:

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
    if (DecoderPrompt.IsOpen)         
    {
        e.Cancel = true;
        // Navigate to different page:
        NavigationService.Navigate(new Uri("/View/YourView.xaml", UriKind.Relative));
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM