Gets or sets the condition that causes the Shutdown method to be called.
Assembly: PresentationFramework (in PresentationFramework.dll)
Applications stop running only when the Shutdown method of the Application is called. Shut down can occur implicitly or explicitly, as specified by the value of the property.
If you set OnLastWindowClose, Windows Presentation Foundation (WPF) implicitly calls Shutdown when the last window in an application closes, even if any currently instantiated windows are set as the main window (see MainWindow).to
The lifetime of some applications may not be dependent on when the main window or last window is closed, or may not be dependent on windows at all. For these scenarios you need to set the OnExplicitShutdown, which requires an explicit Shutdown method call to stop the application. Otherwise, the application continues running in the background.property to
can be configured declaratively from XAML or programmatically from code.
This property is available only from the thread that created the Application object.
The following example shows how to configureto specify that an application must be closed explicitly.
Available since 3.0