I have a WPF/C# 4.0 App which has an Application file XAML that is:
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="XXX.App"
Startup="Application_Startup"
Exit="Application_Exit"
>
<Application.Resources>
</Application.Resources>
And its exiting method is:
//it seems that it never passes here. Transferred to MainAppWindow_WindowClosing
private void Application_Exit(object sender, ExitEventArgs e)
{
this.Dispatcher.BeginInvokeShutdown(DispatcherPriority.Background);
}
It never passes in this piece of code when the application user closes it. Is it supposed to work this way? Am I doing something wrong?