SilverLight 4页面跳转大全(转载)
生活随笔
收集整理的這篇文章主要介紹了
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" />
總結
以上是生活随笔為你收集整理的SilverLight 4页面跳转大全(转载)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: subst命令镜像虚拟磁盘指南(原创)
- 下一篇: 免费天气预报短信服务