Change ShutdownMode of the application.
Added conformation dialog when closing the window or file.