Manasi
Manasi

Reputation: 13

Persistent global Variable in wp7

When my application is first time launched that time, I am declared a static variable, in that variable I am storing some value, but when I stop the application and open the application again I can't access that variable value again. Can you tell me how to access value of that variable after reopen the app? or where I supposed to save that variable? Thank you.

Upvotes: 0

Views: 573

Answers (1)

Sharjeel Ahmed
Sharjeel Ahmed

Reputation: 2061

If you want to persist the variable value, you need to save it in Isolated Storage so that you can read it every time you open the app. The static variable will no longer exist after the app exits. You can save it as a text or XML file in Isolated storage

You can read more about it here http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402541(v=vs.92).aspx

Upvotes: 2

Related Questions