SilverLight 4页面跳转大全(转载)

//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" />
posted on 2010-07-15 11:25 搏击的小船 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/guanjie20/archive/2010/07/15/1777862.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值