title: Code for unhandled exception not working
body: <p>I am using following code for unhandled exceptions.</p>
  
  <pre><code>private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
      {
          if (System.Diagnostics.Debugger.IsAttached)
          {
              // An unhandled exception has occurred; break into the debugger
             System.Diagnostics.Debugger.Break();
          }
  
  
          e.Handled = true;
          Error.Exp = e.ExceptionObject;
          (RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Source = new Uri("/Error.xaml", UriKind.Relative);
      }
  </code></pre>
  
  <p>This code should direct the control to <code>Error.xaml</code> page but it goes to visual studio with the error message of the exception (even after commenting out <code>if</code> block). What is wrong here ?</p>
  
  <p>The source of error is </p>
  
  <pre><code>GeneralTransform generalTransform1 = canvas1.TransformToVisual(start_rec);
  </code></pre>
  
  <p>Error message was
  "Argument exception was unhandled. The parameter is incorrect."</p>