To shut down or exit from your application the best method to be used is
Application.Current.Shutdown();
Now you may ask me what is the difference between Application.Current.Shutdown() method and System.Environment.Exit() method?
The Application.Current.Shutdown() method ensures the Closing and Closed notifications of the window.
The System.Environment.Exit() method just close the application and wont ensure the Closing and Closed notification of the window.
No comments:
Post a Comment