c# - Save and read settings value in Windows Phone 8.1 -


i have page in windows phone, user has chose 1 value (a string) in combobox item. after presses button, value should stored in settings preference. how can this? also, value should read in other page/class in windows phone 8.1 application. tried code, doesn't work:

        private void save(object sender, routedeventargs e)     {         var applicationdata = windows.storage.applicationdata.current;          var roamingsettings = applicationdata.roamingsettings;          // create simple setting          roamingsettings.values["surname"] = surnamesbox.selecteditem;     } 

the problem try save selecteditem object itself. convert string:

roamingsettings.values["surname"] = surnamesbox.selecteditem.tostring(); 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -