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:
//In App.xaml.cs
//Point no 1
private void Application_Launching(object sender, LaunchingEventArgs e)
{
object noOfWordsForLearning;
IsolatedStorageSettings.ApplicationSettings.TryGetValue("savedNoOfWords", out noOfWordsForLearning);
if (noOfWordsForLearning != null)
{
Application.Current.Resources["savedNoOfWords"] = noOfWordsForLearning;
}
}
//Point no 2
private void Application_Closing(object sender, ClosingEventArgs e)
{
IsolatedStorageSettings.ApplicationSettings["savedNoOfWords"] = noOfWordsForLearning;
}
- Load values from IsoStorage to Application.Current.Resources when application launched
- Store setting values from Application.Current.Resources to IsoStorage just before application closed
- During application run, only read and write settings to Application.Current.Resources
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.