Author Posts

January 25, 2017 at 11:30 pm

I have a main window that has a button. When the button is click, it will open another wpf window called w2. If I close w2, the next time I click the button I get an error message basically saying that the window was closed and cannot be reused.

How can I make sure that a new wpf window is created everytime the button is clicked?
Note: I am using visual studio to create the window.


January 26, 2017 at 5:35 pm

Without seeing code (and please use a Gist versus posting a huge chunk), it's hard to tell. But essnetially you must create a brand new instance from scratch, rather than reusing a prior reference.