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();

 

COMMENT USING
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
Tags
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.