我是 WPF 新手。我想通过单击按钮从一种表单重定向到另一种表单。这在 WPF 中可能吗?请帮助我。
最佳答案
WPF 中的表单被称为 Windows。 Window.Show 将让您打开/显示新窗口。 例如:假设有两个窗口 WindowOne 和 WindowTwo 都派生自 Window。所以代码看起来像:
WindowOneButton_Click(object sender, MouseButtonEventArgs e)
{
WindowTwo windowTwo = new WindowTwo();
//this will open your child window
windowTwo .Show();
//this will close parent window. windowOne in this case
this.Close();
}
希望这有帮助。
关于.net - 在 WPF 中从一个页面重定向到另一页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6622408/