Recommended

  • Silverlight 4 Podcast Pack with Tim Heuer
  • Building Modular Silverlight Applications
  • Prism -  10 Things to Know
  • Securing Silverlight Application and WCF Service using ASP.Net Authentication Techniques
  • Model– View – ViewModel in Silverlight
Skip Navigation LinksHome / Tips / View Tip

Tip: How to handle Silverlight application exit?

+ Add to SilverlightShow Favorites
4 comments   /   posted by Denislav Savkov on Sep 03, 2008
(0 votes)
Categories: General

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!

Share


Comments

Comments RSS RSS
  • RE: Tip: How to handle Silverlight application exit?  

    posted by John on Jul 13, 2009 17:35
    Have you actually tried to run code within the event handler?  It doesn't work...
  • RE: Tip: How to handle Silverlight application exit?  

    posted by Darryl on Aug 06, 2009 12:35
    If you're using Visual Studio as your project creation point you want to open the App.xaml.cs file that is automatically created for you and add your code into the Application_Exit(object sender, EventArgs e) method that is created for you.
  • RE: Tip: How to handle Silverlight application exit?  

    posted by fanshengrui on Jan 28, 2010 14:06

    Can you help me?

    I Can't Work With the Exit Event Handler? I'm Waiting the Answer......

  • RE: Tip: How to handle Silverlight application exit?  

    posted by iiordanov on Jan 28, 2010 14:33

    Hi fanshengrui,

    What is the reason you cannot work with the ExitEvent handler? Do you get an error?

Add Comment

 
 

   
  
  
   
Please add 7 and 4 and type the answer here: