locked
Persisting settings from a flyout RRS feed

  • Question

  • I want to use a flyout to store app settings and restore them when the app is run again. I am not sure how much in-built management of this there is, I have tried a simple bit of code to achieve this but its not working, any help or pointers to help would be appreciated

    To Save the setting

                Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
                roamingSettings.Values["StartPage"] = 1;

    To Load the setting

                Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
                if (roamingSettings.Values.ContainsKey("StartPage"))
                {
                    int StartPage = (int)roamingSettings.Values["StartPage"];


    Mal

    Thursday, February 6, 2014 10:47 AM

Answers

  • Ok sorted it, I was using the isChecked method of the radio button to set it, changed that to LostFocus and it all works fine now

    Thanks


    Mal

    • Marked as answer by MalBall Thursday, February 6, 2014 11:25 AM
    Thursday, February 6, 2014 11:25 AM

All replies

  • it looks good. having more code what your doing? RoamingSettings are synced between different machines.

     LocalSettings stay on the machine


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, February 6, 2014 10:56 AM
  • Ok sorted it, I was using the isChecked method of the radio button to set it, changed that to LostFocus and it all works fine now

    Thanks


    Mal

    • Marked as answer by MalBall Thursday, February 6, 2014 11:25 AM
    Thursday, February 6, 2014 11:25 AM