I have a problem in a WPF Application. When I close my application from the Window task bar (Close window) or press Alt + F4 it never hits the Application_exit event handler in my App.xaml file.
<Application x:Class="WPFApplication.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="Application_Startup" Exit="Application_Exit"> Code behind
private void Application_Exit(object sender, ExitEventArgs e) { Application.Current.Shutdown(); }
this.Close()? It callsApplication.Current.Shutdown(). Also, you may need a return statement after yourApplication.Current.Shutdown(), but I can't remember for sure if that's necessary.