Tuesday, May 6, 2014

Windows Phone 8 - How to get a certain IsolatedStorageSetting Key

Problem

I was puzzling over this issue due to isolated storage which I am using on one of my applications.
I need to retrieve a setting from storage but was could not assume that the key exists.  If I attempted to query a null value then I would get an error. 

Solution

ICollection<string> sKeys = (ICollection<string>) IsolatedStorageSettings.ApplicationSettings.Keys
if(!sKeys.Contains(AppResources.SavedReportKeyName))
{
//Create key in isolated storage
}


Source:
http://social.msdn.microsoft.com/Forums/wpapps/en-US/529d6dad-fcfe-4609-9a64-097dcd0bae33/how-to-get-a-certain-isolatedstoragesetting-key?forum=wpdevelop

No comments:

Post a Comment