有没有办法在silverlight导航应用程序中获取上一页网址 [英] Is there any way to get previous page url in silverlight navigation application

查看:13
本文介绍了有没有办法在silverlight导航应用程序中获取上一页网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在silverlight 导航应用程序中获取上一页网址.我正在使用导航服务.

Is there any way to get previous page url in silverlight navigation application. I am using navigation Service.

推荐答案

导航历史无法获取,可以通过监听导航服务事件自行存储NavigationService.Navigated(或 Frame.Navigated框架导航).

There is no way to get the navigation history, you can store it by yourself by listening the navigation service event NavigationService.Navigated (or Frame.Navigated for frame navigation).

private List<Uri> _navigationHistory = new List<Uri>();

void  onNavigated(object sender, NavigationEventArgs e)
{
    _navigationHistory.Add(e.Uri);
}

private Uri getBackUri()
{
        return _navigationHistory.Count > 1
            ? _navigationHistory[_navigationHistory.Count - 2]
            : null;
}

这篇关于有没有办法在silverlight导航应用程序中获取上一页网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆