0

In Silverlight Out of Broweser, How does one: 1) Throw an Exception 2) Display Messagebox with the error 3) Terminate the Application?

Can't seem to find any info on the net. Cheers!

user1034912
  • 2,153
  • 7
  • 38
  • 60

1 Answers1

0

Exceptions work in Silverlight as in any C# code.

Here's a simple sample code that should help you.

try
{
  //Whatever you want to try
}
catch(Exception e)
{
  //Display error message
  MessageBox.Show(e.Message);

  //Close the application
  Application.Current.MainWindow.Close();
}
Nooodles
  • 95
  • 6