SilverLight 4页面跳转大全
来源:互联网 发布:淘宝积分有什么用 编辑:程序博客网 时间:2024/05/01 05:50
//Silverlight页面的跳转
//(Application.Current.RootVisual as IContent).Content = new DragControl();
//普通页面跳转
HtmlWindow html = HtmlPage.Window;
//html.Navigate(new Uri("http://www.0379zd.com"));//普通网址
html.Navigate(new Uri("../Index.aspx", UriKind.Relative));//相对路径
参考一:
方法一: 可跳转到网页
HtmlWindow html = HtmlPage.Window;
html.Navigate(new Uri(item.Link_Page.Trim(), UriKind.Relative), "_blank");
//System.Windows.Browser.HtmlPage.PopupWindow(new Uri(HtmlPage.Document.DocumentUri, item.Link_Page.Trim()), "_Blank",null);
方法二:跳转到Xaml页
this.Content = new About();
方法三:框架跳转item.Link_Page.Trim():代表xaml名 e.g: /views/home
events = new System.Uri(item.Link_Page.Trim(), UriKind.Relative);
this.ContentFrame.Source = events;
框架
<navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
Source="/Views/About" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
<uriMapper:UriMapping Uri="/Views/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
链接
<HyperlinkButton x:Name="userid" NavigateUri="/Views/Home" Style="{StaticResource LinkStyle}" TargetName="ContentFrame" />
HtmlWindow html = HtmlPage.Window;
html.Navigate(new Uri(item.Link_Page.Trim(), UriKind.Relative), "_blank");
//System.Windows.Browser.HtmlPage.PopupWindow(new Uri(HtmlPage.Document.DocumentUri, item.Link_Page.Trim()), "_Blank",null);
方法二:跳转到Xaml页
this.Content = new About();
方法三:框架跳转item.Link_Page.Trim():代表xaml名 e.g: /views/home
events = new System.Uri(item.Link_Page.Trim(), UriKind.Relative);
this.ContentFrame.Source = events;
框架
<navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
Source="/Views/About" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
<uriMapper:UriMapping Uri="/Views/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
链接
<HyperlinkButton x:Name="userid" NavigateUri="/Views/Home" Style="{StaticResource LinkStyle}" TargetName="ContentFrame" />
参考二:
问题:从页面A跳转到页面B.
方法:在页面A的cs文件中:
1.先引入命名空间:
using System.Windows.Browser;
2.跳转语句:
OK了,今天刚搞好的,也不知道可有其他办法了,再来找找,要有更好的办法,我再加进来吧.
方法:在页面A的cs文件中:
1.先引入命名空间:
using System.Windows.Browser;
2.跳转语句:
HtmlWindow html = HtmlPage.Window;
html.Navigate(new Uri("/Default.aspx",UriKind.Relative));
注意黑体字部分,如果要使用相对路径的话,必须加上,全路径的话,可以不用.html.Navigate(new Uri("/Default.aspx",UriKind.Relative));
OK了,今天刚搞好的,也不知道可有其他办法了,再来找找,要有更好的办法,我再加进来吧.
- SilverLight 4页面跳转大全
- SilverLight 4页面跳转大全
- SilverLight 4页面跳转大全
- silverlight页面间跳转
- Silverlight的页面跳转
- 自制Silverlight页面跳转缓存
- silverlight之间的页面跳转
- JSP页面跳转大全
- JSP页面跳转大全
- 跳转页面大全
- JSP页面跳转大全
- JSP页面跳转大全
- JSP页面跳转大全
- JSP页面跳转大全
- JSP页面跳转大全
- 页面跳转大全
- JSP页面跳转大全
- JSP页面跳转大全
- 编写WCF服务时右击配置文件无“Edit WCF Configuration”远程的解决办法
- 如何正确去女生家里修电脑
- 帮帮忙做个查询小案例
- 查找、检索 算法-总结3 平衡二叉查找树 [AVL]
- 解决不同浏览器上中文文件名的下载乱码问题
- SilverLight 4页面跳转大全
- 在winxpsp3下用TransEdit3.5.4扫描频道自动关机故障
- Windows 7下使用VMware vSphere Client
- MERGE语句的使用(复制表)
- 在web html页面中,打印、预览当前页面
- 图篇
- 编写脚本使用的COM组件
- 端午百望山爬山活动-金山词霸运营团队活动
- ASP.NET中各命名空间及作用