The main events fired from Application include:
* Startup - Application is starting up.
* Exit – Fired when an application is shutting down.
* Activated – Fired when an application gets focus, i.e. becomes the foreground application
* Deactivated – Fired when application loses focus, i.e. is no longer the foreground application
* DispatcherUnhandledException – Fired when an exception is thrown, but not yet handled. You can choose to handle the exception or not
* SessionEnding – Fired when Windows is being shut down–due to either logoff or Windows shutdown. You can cancel the shutdown sequence.
* You can add custom code for any of these events by just overriding the OnEventName method in your Application-derived class, e.g. OnStartup.
Source: Interview | Asked In: Many Interviews |