title: Application settings binding best practices
body: <p>I've been struggling for a while now with how to best "interact" with settings on a binding level in a WinRT/UWP app. I've been looking for best practices regarding this, but I haven't found clear answers. What I've done so far in my apps is the following:</p>
  
  <ol>
  <li>Define a BindableBase which implements INotifyPropertyChanged.</li>
  <li><p>Create an AppSettings class which inherits from BindableBase and looks a bit like this:</p>
  
  <pre><code>public class AppSettings : BindableBase
  {
      ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
  
      public string MySetting
      {
          get
          {
              if (!localSettings.Values.ContainsKey("MySetting"))
                  localSettings.Values["MySetting"] = "Some default value";
  
              return localSettings.Values["MySetting"].ToString();
          }
          set
          {
              localSettings.Values["MySetting"] = value;
              RaisePropertyChanged();
          }
      }
  }
  </code></pre></li>
  <li><p>Define a ViewModel which has a an AppSettings property:</p>
  
  <pre><code>public class SettingsViewModel
  {
      public AppSettings Settings { get; set; } = new AppSettings();
  }
  </code></pre></li>
  <li><p>Bind to the Settings property in the View:</p>
  
  <pre><code>&lt;TextBlock Text="{Binding Settings.MySetting, Mode=TwoWay}"&gt;
  </code></pre></li>
  </ol>
  
  <p>I've seen and used implementations in the past that had a settings service, but these applications didn't need the settings changes to go in effect immediately. So what I'm basically asking is: If changes to settings should go immediately into effect, is the above implementation a good way to bind to settings? If not, what do you recommend?</p>