locked
Use foreach loop with Windows.Storage.ApplicationData.Current.LocalSettings RRS feed

  • Question

  • How to use foreach loop with Windows.Storage.ApplicationData.Current.LocalSettings to access all the values without knowing their names.
    Wednesday, July 1, 2015 1:56 PM

Answers

  • Hi Prashant Main,

    C# code for your reference:

                var settingValues = Windows.Storage.ApplicationData.Current.LocalSettings.Values.Values;
    
                foreach(var value in settingValues)
                {
                    Debug.WriteLine(value);
                }

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 2, 2015 6:10 AM

All replies

  • I would probably suggest iterating the Keys property.

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Wednesday, July 1, 2015 9:21 PM
  • Hi Prashant Main,

    C# code for your reference:

                var settingValues = Windows.Storage.ApplicationData.Current.LocalSettings.Values.Values;
    
                foreach(var value in settingValues)
                {
                    Debug.WriteLine(value);
                }

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 2, 2015 6:10 AM