<Application x:Class="exception1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SDM1"
StartupUri="MainWindow.xaml"
DispatcherUnhandledException="myexception">
<Application.Resources>
</Application.Resources>
</Application>
public partial class App : Application
{
private void myexception(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show("An unhandled exception just occurred: " + e.Exception.Message, "Exception Sample", MessageBoxButton.OK, MessageBoxImage.Warning);
e.Handled = true;
}
}
Gdy wywołuję umyślnie wyjątek, nic się nie dzieje, program się crashuje, a powinien otwierać okienko z info o błędzie, co robię źle?