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