Application.Shutdown Method ()
Assembly: PresentationFramework (in presentationframework.dll)
When Shutdown is called, an application stops running. You can handle the Exit event to detect when an application is about to stop running, to perform any appropriate processing.
Shutdown is implicitly called by Windows Presentation Foundation (WPF) in the following situations:
When the ShutdownMode is set to OnMainWindowClose.
When a user ends a session and the SessionEnding event is either unhandled, or handled without cancellation.
Calling Shutdown explicitly causes an application to shut down, regardless of the ShutdownMode setting. However, if ShutdownMode is set to OnExplicitShutdown, you must call Shutdown to shut down an application.
When Shutdown is called, the application will shut down irrespective of whether the Closing event of any open windows is canceled.
This method can be called only from the thread that created the Application object.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.