我是Windows 7应用程序开发的新手。我不明白如何从主xaml屏幕加载新的xaml屏幕,比如单击按钮。有人能帮帮我吗?
发布于 2012-07-09 14:10:54
您可以使用以下命令:
private void Button_Click(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/<nameofproj>;component/<nameofpage>.xaml",UriKind.Relative));
}我试过了,它工作得很好
发布于 2012-07-09 00:36:00
我想你的意思是导航到其他XAML页面?如果是这样,请使用:
NavigationService.Navigate(new Uri("/OtherPage.xaml",UriKind.Relative));发布于 2012-07-09 02:41:57
只需导航!!
为该按钮创建事件处理程序,例如:
private void Button_Click(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/yourProject;component/newPage.xaml", UriKind.Relative));
}您可以稍后使用以下命令返回此页面:
NavigationService.GoBack();https://stackoverflow.com/questions/11384177
复制相似问题