简体   繁体   English

我如何在 C# 中的页面之间导航

[英]how i navigate between pages in C#

How can I navigate forms within the window (I have a button called settings, so when I click it, it should open up within a new window? I used this code, but I doesn't work out with me如何在窗口中导航表单(我有一个名为设置的按钮,所以当我点击它时,它应该在一个新窗口中打开?我使用了这个代码,但我不适合我

Private void Button_Click_4 (object sender, RoutedEventArgs e)
{          
    NavigationService Nov = NavigationService. GetNavigationService (this); 
    Nov.Navigate (new Uri ("Window1. xaml", UriKind. RelativeOrAbsolute));
}

Try this line of code:试试这行代码:

this.Frame.Navigate(typeof(Window1.xaml));

Reference: MSDN: Navigating between pages (XAML)参考: MSDN:在页面之间导航 (XAML)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM