I have a window that I sometimes open using Show()
and sometimes using ShowDialog()
. In the second case, the returned dialog result is important for me. But if I set the DialogResult
after calling Show()
I get an InvalidOperationException
. Is there a way to find out which method was used to open the window and set or not the DialogResult
accordingly? Or is there another way?
Of course I know I can catch and ignore the exception, but I don't like this solution.