3
votes

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.

On my mainWindow:

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

but in window2 if i use the same code to open a new window:

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

it wont allow me to use Show() or 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?

1
Show us the declarations for window2 and window3.Dour High Arch
“it wont allow me to use Show() or ShowDialog().” – How does it tell you that?poke
you will have to bear with me i am really new to C# and programming soJohn Mc Gowan
the intellisence wont let me pick itJohn Mc Gowan

1 Answers

1
votes

ShowDialog is modal (all input constrained to that window). 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