0

I'm trying to set up local settings so I can store data in my Windows Mobile 8 app. The first step I'm trying is:

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;

Just having that in my code causes the app to fail when debugging on my device.

Any ideas why?

I have "using Windows.Storage;" set. The actual code doesn't throw up any errors.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Dan
  • 2,304
  • 6
  • 42
  • 69

1 Answers1

0

I needed to use the IsolatedStorageSettings feature, as below:

IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;

            if (!settings.Contains("test"))
            {
                settings.Add("test", urlText.Text);
            }
            else
            {
                settings["test"] = urlText.Text;
            }
            settings.Save(); 
Dan
  • 2,304
  • 6
  • 42
  • 69