如何从桌面WPF应用程序的页面导航到新页面或Window
。我曾尝试以下调用Windows的页面,但我得到的错误:从桌面WPF应用程序的页面导航到新页面或窗口
Window must be the root of the tree. Cannot add Window as a child of Visual
private void btCode_Click(object sender, RoutedEventArgs e)
{
CodeView window = new CodeView(cbRe.Text, txtID.Text);
this.Content = window;
}
当我修改代码来调用一个新的页面,我收到了类似的错误说法页面必须从Window
调用。