Initializes a new instance of the MainWindow class.
Handles the Closing event of the mainWindow control.