silverlight页面间跳转

silverlight页面间跳转,第1张

概述// Silverlight页面的跳转 // (Application.Current.RootVisualasIContent).Content=newDragControl();    //Silverlight页面的跳转 //(Application.Current.RootVisual as IContent).Content = new DragControl(); //普通页面跳转 H // Silverlight页面的跳转 // (Application.Current.RootVisualasIContent).Content=newDragControl();   

//Silverlight页面的跳转
//(Application.Current.RootVisual as IContent).Content = new DragControl();
//普通页面跳转
HTMLWindow HTML = HTMLPage.Window;
//HTML.Navigate(new Uri("http://www.Silverlightchina.net"));//普通网址
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" />

参考二:
问题:从页面A跳转到页面B.
方法:在页面A的cs文件中:
1.先引入命名空间:
    using System.windows.browser;
2.跳转语句:

HTMLWindow HTML = HTMLPage.Window; HTML.Navigate(new Uri("/Default.aspx",UriKind.relative));注意黑体字部分,如果要使用相对路径的话,必须加上,全路径的话,可以不用. OK了,今天刚搞好的,也不知道可有其他办法了,再来找找,要有更好的办法,我再加进来吧.

总结

以上是内存溢出为你收集整理的silverlight页面间跳转全部内容,希望文章能够帮你解决silverlight页面间跳转所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1067518.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存