简体   繁体   English

在新窗口中打开新窗口

[英]Open new window in a new window

So Here is the thing i can open new windows in WPF but what i am trying to do is after opening a new window (lets call it window2) i want to be able to open another new window(window3)from window2 but when i put in the code it wont let me. 所以这是我可以在WPF中打开新窗口的东西,但我想要做的是打开一个新窗口后(让我们称之为window2)我希望能够从window2打开另一个新窗口(window3)但是当我放在代码中它不会让我。

On my mainWindow: 在我的mainWindow上:

var newWindow = new window2();
newWindow.ShowDialog();

but in window2 if i use the same code to open a new window: 但在window2中,如果我使用相同的代码打开一个新窗口:

var newWindow = new window3();
newWindow.ShowDialog();

it wont allow me to use Show() or ShowDialog(). 它不允许我使用Show()或ShowDialog()。

So what i was wondering was can u open a 3rd window like this or is there something i am missing or is there something different i can do? 所以我想知道的是你可以打开这样的第三个窗口,还是我缺少一些东西或者我能做些什么?

ShowDialog is modal (all input constrained to that window). ShowDialog是模态的(所有输入都被约束到该窗口)。 You have to close the modal window before opening any other windows, thats the point of it! 你必须在打开任何其他窗口之前关闭模态窗口,这就是它的意义!

What are you actually trying to achieve? 你究竟想要实现什么目标? In general modal windows are not a good user experience 通常,模态窗口不是一个好的用户体验

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

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