Skip to main content
deleted 11 characters in body
Source Link
Kylo Ren
  • 8.9k
  • 6
  • 44
  • 68

Use Use any of the following as needed:

1.

 App.Current.Shutdown(); OR Application.Current.Shutdown(); 

2.

 App.Current.MainWindow.Close(); OR Application.Current.MainWindow.Close(); 

3. Above all methods will call closing event of Window class and execution may stop at some point (cause usually applications put dialogues like 'are you sure?' or 'Would you like to save data before closing?', before a window is closed completely)

B3.ut But if you want to terminate the application without any warning immediately. Use below

 Environment.Exit(0); 

Use any of the following:

1.

 App.Current.Shutdown(); OR Application.Current.Shutdown(); 

2.

 App.Current.MainWindow.Close(); OR Application.Current.MainWindow.Close(); 

3. Above all methods will call closing event of Window class and execution may stop at some point (cause usually applications put dialogues like 'are you sure?' or 'Would you like to save data before closing?', before a window is closed completely)

But if you want to terminate the application without any warning immediately. Use below

 Environment.Exit(0); 

Use any of the following as needed:

1.

 App.Current.Shutdown(); OR Application.Current.Shutdown(); 

2.

 App.Current.MainWindow.Close(); OR Application.Current.MainWindow.Close(); 

Above all methods will call closing event of Window class and execution may stop at some point (cause usually applications put dialogues like 'are you sure?' or 'Would you like to save data before closing?', before a window is closed completely)

3. But if you want to terminate the application without any warning immediately. Use below

 Environment.Exit(0); 
added 197 characters in body
Source Link
Kylo Ren
  • 8.9k
  • 6
  • 44
  • 68

UseUse any of the following:

1.1.

 App.Current.Shutdown(); OR Application.Current.Shutdown(); 
 

2.

  App.Current.MainWindow.Close(); OR   Application.Current.MainWindow.Close(); 
  1. above all methods will call closing event of windows and execution may stop at some point But if you want to terminate the application without any warning immediately. use below

3. Above all methods will call closing event of Window class and execution may stop at some point (cause usually applications put dialogues like 'are you sure?' or 'Would you like to save data before closing?', before a window is closed completely)

But if you want to terminate the application without any warning immediately. Use below

 Environment.Exit(0); 

Use any of the following:

1.

 App.Current.Shutdown(); OR Application.Current.Shutdown(); 
 
  App.Current.MainWindow.Close(); OR   Application.Current.MainWindow.Close(); 
  1. above all methods will call closing event of windows and execution may stop at some point But if you want to terminate the application without any warning immediately. use below
 Environment.Exit(0); 

Use any of the following:

1.

 App.Current.Shutdown(); OR Application.Current.Shutdown(); 

2.

 App.Current.MainWindow.Close(); OR Application.Current.MainWindow.Close(); 

3. Above all methods will call closing event of Window class and execution may stop at some point (cause usually applications put dialogues like 'are you sure?' or 'Would you like to save data before closing?', before a window is closed completely)

But if you want to terminate the application without any warning immediately. Use below

 Environment.Exit(0); 
Source Link
Kylo Ren
  • 8.9k
  • 6
  • 44
  • 68

Use any of the following:

1.

 App.Current.Shutdown(); OR Application.Current.Shutdown(); 
 App.Current.MainWindow.Close(); OR Application.Current.MainWindow.Close(); 
  1. above all methods will call closing event of windows and execution may stop at some point But if you want to terminate the application without any warning immediately. use below
 Environment.Exit(0);