When closing the MainWindow, ask the user if that's what he wants. If he replies yes, then close the Window, otherwise keep it open.