Sometimes you might need to handle the application exit event of a Silverlight application in order to logout, clear or perform any other operations required by your internal logic. Exactly for this reason there is an Exit event located in your project application class that directly derives from System.Windows.Application. In most cases the name of this class is App and you can access its Exit event like this:
C#
App.Current.Exit += new EventHandler( ApplicationExit );
That's it!