I cannot yet comment on answers due to my reputation, but please be wary using steveg89's solution. If at any point you add more values to IsolatedStorageSettings that are unrelated to your 'favorites' those will also be iterated on when using his method.
I would instead suggest storing all 'favorites' in a Dictionary and then saving the IsolatedStorageSettings. When you'd like to add a new entry, simple load the Dictionary from settings, check if the value exists in the Dictionary, and if not add it and then resave to IsolatedStorageSettings.
Then, in order to load the values, simply load the Dictionary and iterate through that instead.
Something like this:
//Loading items into Dictionary
Dictionary<string, string> tempDictionary = new Dictionary<string, string>();
if (IsolatedStorageSettings.ApplicationSettings.Contains("stopNumberDictionary"))
{
tempDictionary = IsolatedStorageSettings.ApplicationSettings["stopNumberDictionary"] as Dictionary<string, string>;
}
else
{
IsolatedStorageSettings.ApplicationSettings.Add("stopNumberDictionary", tempDictionary);
}
if (!tempDictionary.Contains(stopNumber))
{
tempDictionary.Add(stopNumber, stopAddress);
}
IsolatedStorageSettings.ApplicationSettings["stopNumberDictionary"] = tempDictionary;
IsolatedStorageSettings.ApplicationSettings.Save();
//Then load Dictionary OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
Dictionary<string, string> tempDictionary = new Dictionary<string, string>();
if (IsolatedStorageSettings.ApplicationSettings.Contains("stopNumberDictionary"))
{
tempDictionary = IsolatedStorageSettings.ApplicationSettings["stopNumber"] as Dictionary<string, string>;
}
foreach(KeyValuePair<string, string> entry in tempDictionary)
{
lstStops.Items.Add(entry.Value as string);
}
base.OnNavigatedTo(e);
}