How to gracefully handle computer shutdown from WPF application

From Yggenyk
Revision as of 14:35, 25 April 2014 by WikiSysop (talk | contribs)
Jump to navigation Jump to search

WPF application lifetime.png

Application Events

When you start the application

Startup -> Activated

When you shut the application down normally (i.e. close main window)

Deactivated -> Exit

If user is logging out of or shutting down Windows

Deactivated -> SessionEnding

Application gets focus

Activated

Application loses focus

Deactivated

AppDomain Events

When an exception is not caught

UnhandledException

(DispatcherUnhandledException is raised by an Application for each exception that is unhandled by code running on the main UI thread, but if you can safely ignore that and wait for UnhandledException is raised by AppDomain)


id=siteTree