How do I maintain the Silverlight application state server so that the user clicks the browser refresh button?

I am learning Silverlight 3 and in all my tests, when I click the browser refresh button, the SL application restarts.

Is there any way to avoid this?

+6
browser silverlight
source share
3 answers

Isolated Storage. You can save the settings, as well as indicate the status of the application ...

http://silverlight.net/learn/learnvideo.aspx?video=65677

I would recommend creating a silverlight application in such a way as to save enough so that the update returns the user to a significant place.

you can watch Silverlight3 Navigation: http://www.davidpoll.com/?p=88

If you have a huge problem updating the application by the user, you can try to open a new browser window that does not have a menu or toolbar ... but you will encounter pop-up blockers ...

http://www.webdevelopersnotes.com/tutorials/javascript/creating_opening_new_window_pop_ups_javascript.php3

+6
source share

Afaik you cannot cancel the restart of the application. What you can do is to handle the Exit event in App.xaml.cs and save the settings in IsoStore as suggested above, and then load them into the Startup event (the same class). I assume that you can make it a smooth transition by returning it back to the state that was present during the Exit event.

+3
source share

Unable to save state "automatically". However, using the navigation infrastructure in SL3 , you can reach a certain level of state: when you click "Update", the application will restart, but will go to the same page as before.

Something similar was done in Quince: http://quince.infragistics.com/#/Search/ViewPattern $ pattern = Action + Links

The part of the URL after # is read by the application and always moves to the same place.

This will not work if a lot of data is saved, since you need to save the state in the url. However, it has a good side effect that provides deep binding.

+2
source share

All Articles