从哪个页面导航到给定页面

时间:2015-01-02 16:45:31

标签: windows-runtime windows-phone-8.1 back-button

我想知道通过按后退按钮从哪个页面导航到给定页面。但我没有在WP8.1中找到解决方案 据我所知,参数可以用于前进导航 任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

您想知道在用户导航回当前页面之前显示的是哪个页面?您可以检查Frame.ForwardStack

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    if (e.NavigationMode == NavigationMode.Back)
    {
        // get the type of the page that was shown previously
        var navigatedFromPage = Frame.ForwardStack[0].SourcePageType;
    }
}
相关问题