Search code examples
c#xamlwindows-phone-8.1isolatedstorage

isolated storage in windows phone 8.1


I'm using VS 2015 to develop windows phone8.1 app. I have a text box and a button in page1.When I enter text in text box and click on the button, the entered text should get stored in the Isolated storage and it should be displayed on the next page.I am new to c#, Can anyone help me?


Solution

  • page1:(write value)

    Windows.Storage.ApplicationData.Current.LocalSettings.Values["settingName"] = "settingValue";
    

    page2 (read value):

    Object settingValue = Windows.Storage.ApplicationData.Current.LocalSettings.Values["settingName"];
    if (value != null)
    {  
      //do your thing  
    }