Silverlight 重定向
大家好,谁能告诉我如何执行此操作...我有一个包含两个 XAML 页面的 Silverlight 应用程序。在第一个上我有一个按钮。单击该按钮时,我想将用户重定向到第二个 XAML 页面。
我怎样才能做到这一点?
这是我到目前为止所拥有的:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.HelloMessage.Text = "Hello Universe";
}
private void button1_Click(object sender, RoutedEventArgs e)
{
}
private void HelloMessage_Loaded(object sender, RoutedEventArgs e)
{
MessageBox.Show("This is the load event for this page");
}
}
Hi guys can anyone tell me how to do this... I have a Silverlight application with two XAML pages. On the first one I have a button. When the button is clicked I would like to redirect the user to the second XAML page.
How can I accomplish this?
This is what i have so far:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.HelloMessage.Text = "Hello Universe";
}
private void button1_Click(object sender, RoutedEventArgs e)
{
}
private void HelloMessage_Loaded(object sender, RoutedEventArgs e)
{
MessageBox.Show("This is the load event for this page");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您确实需要从一个 XAML 页面导航到另一页面,这将为您指明正确的方向:Silverlight 导航概述。不过,我想说的是,在 Silverlight 应用程序中,如果您只是尝试在页面上显示不同的内容,那么您通常不会遵循标准的 Web 导航范例。
If you really have a need to navigate from one XAML page to another, this will set you in the right direction: Silverlight Navigation Overview. I would say, however, that in a Silverlight app, if you're simply trying to display different content on the page, you don't generally follow the standard web navigation paradigm.
其中 MySecondPage 是您要导航到的 xaml 页面。
where MySecondPage is the xaml page to which you want to navigate to.