//File:MainWindow.xaml.vb Imports System Imports System.Windows Namespace DispatcherUnhandledExceptionSample Public Partial Class MainWindow Inherits Window Public Sub New() InitializeComponent() End Sub Private Sub raiseRecoverableException_Click(sender As Object, e As RoutedEventArgs) Throw New DivideByZeroException("Recoverable Exception") End Sub Private Sub raiseUnecoverableException_Click(sender As Object, e As RoutedEventArgs) Throw New ArgumentNullException("Unrecoverable Exception") End Sub End Class End Namespace