title: How to exit an application properly
body: <p>Usually, I will just use <code>Environment.Exit(code)</code> to exit an application. (Usually through a button click.) But I would like to know is it the proper way to exit, ie, releasing memory etc etc...</p>