
Originally Posted by
jmcilhinney
Hmmm... just did a quick test and apparently closing a WPF Window that was displayed using ShowDialog disposes it. The equivalent action in WinForms does not dispose the form, so that's a difference.
Yeah that and also you cant actually dispose a WPF window - you just call Close and the garbage collector sorts it out. I think the fact that dialog forms dont stay open is a good thing because it never made sense to me for them to act any differently to when you show the form in non-dialog mode, but I dont like the fact that you cant manually dispose the window.
As for the OP's original problem - you must be showing the window and then closing it and then trying to show it again or something... this is all you should be doing:
Code:
Dim SomeWindow As New MainWindow
SomeWindow.ShowDialog()