SilverLight 4页面跳转的方法

2010-05-10 11:31 阅读(?)评论(0)

    

 

 

方法一: 可跳转到网页
                  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" />
   阅读(?)评论(0)
上一篇: 我和你的第一次 下一篇:wcf1
 
表  情:
加载中...
 

请各位遵纪守法并注意语言文明