Resource

How to Close a WPF application programmatically?

XAML Designer Resources Oct 25, 2009
Shutdown method of Application class in WPF is used to stop an application immediately regardless if Close event is fired or not.

Shutdown method of Application class in WPF is used to stop an application immediately regardless if Close event is fired or not. Shutdown method is called implicitly on Window close and MainWindow close events when Shutdown mode is set to OnLastWindowClose, OnMainWindowClose respectively.

Application curApp = Application.Current;
curApp.Shutdown();

 

post comment
     
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter