Should Application.Current.Shutdown() NOT be used as a best practice to close a WPF application?
I have a small, multiple window application and the “shutdown” seems to work nicely for all my exit commands. However, I have been told to always use Application.Current.MainWindow.Close().
MainWindow.Closewon’t even do anything if theShutdownModeis not set respectively. You can do what you want, it should just fit what one expects.(
Shutdownwill ignore the fact that someClosingevent was cancelled, so that would be one thing you need to take into consideration)Also: