title: Using Xamarin, why would my application setting default to false?
body: <p>I am running into a really strange problem.  I have created an application setting for an iPad application, and for some reason the setting is defaulting to false- but only until the user opens the settings and observes the actual setting.  After being observed at least once, the setting will always return the correct value, whether it is true or false (if the setting were a quantum particle it would make more sense to me).  This behavior only occurs on device, not in simulator.  Also, it is consistent when I launch in debug mode on device or when I release through TestFlight.</p>
  
  <p>My setting is defined in Root.plist, which is located in my client solution in the Settings.bundle folder. All of the other settings defined in this file work fine.</p>
  
  <p>Since I can't really show the Xamarin designer, here's my XML from Root.plist:
  </p>
  
  <pre><code>&lt;dict&gt;
      &lt;key&gt;Title&lt;/key&gt;
      &lt;string&gt;Camera Settings&lt;/string&gt;
      &lt;key&gt;Type&lt;/key&gt;
      &lt;string&gt;PSGroupSpecifier&lt;/string&gt;
  &lt;/dict&gt;
  &lt;dict&gt;
      &lt;key&gt;DefaultValue&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;Key&lt;/key&gt;
      &lt;string&gt;useCameraForScanning&lt;/string&gt;
      &lt;key&gt;Title&lt;/key&gt;
      &lt;string&gt;Use Camera for Scanning&lt;/string&gt;
      &lt;key&gt;Type&lt;/key&gt;
      &lt;string&gt;PSToggleSwitchSpecifier&lt;/string&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>And here's my accessor code:
  </p>
  
  <pre><code>private const string useCameraForScanningKey = "useCameraForScanning";
  private static bool useCameraForScanning = true;
  public static bool UseCameraForScanning
  {
      get
      { 
          bool useCamera = NSUserDefaults.StandardUserDefaults.BoolForKey(useCameraForScanningKey);
          useCameraForScanning = useCamera;
          return useCameraForScanning; 
      }
      set { NSUserDefaults.StandardUserDefaults.SetBool(value, useCameraForScanningKey); }    
  }
  </code></pre>
  
  <p>Breakpoints throughout the accessor prove that the setting is being retrieved as false.  I am very new to this Root.plist business, so I am guessing I am missing something obvious here.  </p>
  
  <p>Thanks in advance for any help offered!</p>