Hwnd of zero is not valid"
error when performing a this.Close(); in the loaded event when the window was open thought a MyWindow.ShowDialog(). by going line by line the this.close(); is in fact called then the loaded event ends and come back to the MyWindow.ShowDialog() and then it crashes on the line. Like it didn't like the return.