9

I'm getting error when I added

IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;

in my MainPage.xaml.cs for button click event.

Errors :

  1. The type or namespace name 'IsolatedStorageSettings' could not be found (are you missing a using directive or an assembly reference?)

  2. The name 'IsolatedStorageSettings' does not exist in the current context

I'm using visual studio ultimate 2013 (update 2).

Please help me

Ashiq Hassan
  • 430
  • 6
  • 13
  • possible duplicate of [Windows Phone 8.1 - Isolated Storage](http://stackoverflow.com/questions/23121146/windows-phone-8-1-isolated-storage) – Bas Peeters Nov 28 '14 at 22:35

1 Answers1

15

Use the classes in Windows.Storage namespace. They are new for Universal Apps (Windows Phone 8.1 & Windows 8.1).

If you want the data to stay always local try Windows.Storage.ApplicationData.Current.LocalSettings.

However, if you wouldn't mind them been stored in roaming settings (they would be available for your app in Windows 8.1 in case you do Universal Apps) you can use Windows.Storage.ApplicationData.Current.RoamingSettings.

For example,

var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
if(localSettings.Values.ContainsKey("LocationConsent"))

or

var roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
if(roamingSettings.Values.ContainsKey("LocationConsent"))
Matthew Haugen
  • 12,916
  • 5
  • 38
  • 54
Vyas
  • 2,734
  • 18
  • 14
  • 1
    Thank you for your help, but i got little bit earlier in msdn forum [http://social.msdn.microsoft.com/Forums/wpapps/en-US/528844a7-0124-4332-92ca-096514bd477c/i-cant-use-isolatedstoragesettings-for-windows-phone-81] . Anyway thank you bro... – Ashiq Hassan Jul 05 '14 at 10:45