Question about DispatcherUnhandledException
<p>The problem in this code is that when it's run and I push "Yes" button, This is shown:</p>

<p><img src="http://i.stack.imgur.com/6JKxW.png" alt="alt text"></p>

<p>This means that my application stopped working, I just want it to end.</p>

<pre><code>private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            string message = "An unhandled exception has ocurred, do you want close the app?";
            MessageBoxResult currentMB = MessageBox.Show(message, "SomeTitleApp", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);

            if (currentMB == MessageBoxResult.Yes)
            { Application.Current.Shutdown(); }
            else
            { e.Handled = true; }
        }
</code></pre>
