none
Silverlight Load and Unload events

    Question

  • Hi,

            I am developing a web application in integration with Silverlight.I have both general .aspx pages and one .aspx page which is using Silverlight.

    So, when user is navigating to this Silverlight Page and when navigated out from this page, can we recognise through using any events in Silverlight, as I need to do some stuff when he is viewing that and when he is left that.

    So, I am just wondering if we have any Unload event kind of thing in Silverlight.

    Can you please let me know, how we can deal with that.

    Thanks in advance. 

     

     

    Thursday, February 04, 2010 12:59 PM

Answers

  • You can access the MainPage's Load for loading.  As for unload event, Silverlight doesn't have one natively.  You can try to use the Application.Exit event (App.xaml.cs)

    Thursday, February 04, 2010 1:27 PM

All replies

  • You can access the MainPage's Load for loading.  As for unload event, Silverlight doesn't have one natively.  You can try to use the Application.Exit event (App.xaml.cs)

    Thursday, February 04, 2010 1:27 PM
  • Thanks Fury,It resolved my issue.

    Once again Thanks for your help.

    Thursday, February 04, 2010 2:06 PM
  • Hi Fury,

                  I am unable to do DB operations in Application_Exit method. I am doing a webservice call in Application_Exit to update one table, but that service is never called.

    I have  gone through this link http://forums.silverlight.net/forums/p/18037/61129.aspx and also http://forums.silverlight.net/forums/t/11508.aspx which talks about lighter weight XML HTTP Request.But this link looks like a little bit compilcated approach.

    So, can you provide me if we have any other alternates to do?

    FYI I am using Silverlight 3.0.

    Thanks in advance, Waiting for your reply

     

     

    Sunday, February 07, 2010 3:58 AM