I am trying to hide the window MainWindow
from another window. I thought that the following code would work until I realised that it would just create another instance of MainWindow
, and then hide that, and not the original window!
MainWindow MainWindow = new MainWindow();
MainWindow.Hide();
Then I tried to use just MainWindow.Hide()
but that doesn't work. How can I do it?