I have a "setting page" which will save a value from the user for further use. If the user set this value then this value will be used into main page. In main page first it check if the user set or change the previous saved value or not.If it is changed then it uses the current value otherwise it will use the previous settled value.
I used Application.Current.Resources.
But i found that if my app restart again the value is lost.
What i need is that from the setting page a value named noOfWordsForLearning
(for example) will be saved so that anytime it can be accessed from anypage.If the value is changed anytime the other page can get the changed value. I tried like this.
In setting page:
Application.Current.Resources.Add("savedNoOfWords",noOfWordsForLearning);
In main page:
if (Application.Current.Resources.Contains("savedNoOfWords"))
{
getSavedValueFromSetting = (int)Application.Current.Resources["savedNoOfWords"];
MessageBox.Show("no of saved words is " + getSavedValueFromSetting);
}
else
MessageBox.Show("no of default words is "+getSavedValueFromSetting);
How can i do that??
I dont know if there any performance issue or other concern, but if you want to avoid reading & writing to IsolatedStorage too often, this is what i will do:
Another advantage for you following these steps is.. your existing codes (which only read and save to Application.Current.Resources) will remain unchanged. You just need to add codes to do point 1 & 2. I hope this help, cheers.