views:

57

answers:

2

Hello everyone!

How can I save the state of my Silverlight application in case user pressed back button (or for example pressed on banner inside application) to set the same settings on application resume.

Is there anything similar to registry in Windows Phone 7, some local storage?

Can I use any database to hold application settings and variable values in it?

A: 

The app shutdown on loss of focus is referred to as "tombstoning" (the term may improve your search results). There is a reasonable approach in this blog entry for using isolated storage to store state, though you could also store to a database like Perst as well.

ctacke
Thank you for your reply. This blog entry is very helpful indeed.
Evgeny Vinnik
+3  A: 

There is no in-built database support (unlike in Windows Mobile 6.x) for Windows Phone 7. You have something called IsolatedStorage available within an application. You can use IsolatedStorageSetting.ApplicationSettings to hold your applications' settings, etc when the application is being Tombstoned. Here is a good article that gives you a nice, brief introduction to IsolatedStorage and how to use it to store application settings. You will need to write code in the OnNavigatedTo and OnNavigatedFrom events to restore/save your application's settings. James Ashley has some nice blog posts on Tombstoning and the usage of IsolatedStorage, you can start with this article and proceed to read others in his blog.

I maintain a list of Windows Phone 7 developer resources here, you may find some of them useful.

HTH, indyfromoz

indyfromoz
Thanks for your reply. This list of Windows Phone 7 developer resources that you are maintaining is especially helpful. You are doing great work!
Evgeny Vinnik
No problems at all! I am doing my bit on helping fellow Windows Phone developers build great apps :) Did my answer help you with your question?
indyfromoz