【发布时间】:2008-10-24 21:02:07
【问题描述】:
在 Silverlight 中,我如何启动/导航到另一个页面?
【问题讨论】:
标签: silverlight
在 Silverlight 中,我如何启动/导航到另一个页面?
【问题讨论】:
标签: silverlight
System.Windows.Browser.HtmlPage.Window.Navigate(
new Uri( "http://www.google.com" ),
"_blank"
);
如果您只想在当前浏览器窗口中导航,可以省略目标(“_blank”)。
【讨论】:
从另一个页面导航到另一个页面。
Frame frame =this.parent as Frame;
frame.navigate(new Uri("/Views/Details.xaml"),Uri.Relative);
注意,您必须在 MainPage.xaml 中已有一个框架。 所以其他页面只是调用父级中的框架
【讨论】:
假设您正在编辑 Page 类的文件隐藏代码
this.NavigationService.Navigate(new Uri("/OtherPage.xaml", UriKind.Relative));
【讨论】:
为避免在使用 _blank 时弹出窗口被阻止的问题,请确保从 HyperlinkButton 控件的单击事件中调用 Navigate,如下所述:
http://www.tjsblog.net/2010/10/20/opening-a-new-chrome-page-in-silverlight/
【讨论】:
大家也可以试试这个
this.content=new (place the page name which You want to navigate);
but this code only works while navigate page having in same folder else You have to write like in given below manner
this.Content = new Views.(放置您要导航的页面名称);
here in place of Views write the folder name where the page having...
希望对大家也有帮助。
【讨论】: