I have got the code by using which you can exit the Silverlight application programmatically. You have yo give call as follows.
Following is an implementation of code in App.xaml.cs file:
Code:
private class ExitException : Exception { }
public static void Exit()
{
throw new ExitException();
}
private void Application_UnhandledException(object sender,
ApplicationUnhandledExceptionEventArgs e)
{
if (e.ExceptionObject is ExitException)
return;
if (System.Diagnostics.Debugger.IsAttached)
{
System.Diagnostics.Debugger.Break();
}
//etc.
}
Bookmarks