title: How do I deserialize JSON arrays and bind resulting objects to WPF DataGrids?
body: <p>Given a JSON file with two arrays (let's say one named "people" and one named "places"):</p>
  
  <pre><code>{
      "people": [{
          "name": "Adam",
          "age": 24
      }, {
          "name": "Bill",
          "age": 26
      }, {
          "name": "Charlie",
          "age": 28
      }],
      "places": [{
          "city": "San Francisco",
          "population": 850000
      }, {
          "city": "New York",
          "population": 8400000
      }, {
          "city": "Chicago",
          "population": 2700000
      }]
  }
  </code></pre>
  
  <p>I am loading that from disk and deserializing the JSON using JSON.NET:</p>
  
  <pre><code>using (var sr = new StreamReader(path))
  {
      var json = sr.ReadToEnd();
      _content = JsonConvert.DeserializeObject(json);
  }
  </code></pre>
  
  <p>Where _content is an instance variable declared dynamic. After parsing, this ends up containing a value of type <code>System.Collections.Generic.Dictionary&lt;string, object&gt;</code>. Now, I want to display this data in two DataGrids:</p>
  
  <pre><code>&lt;DockPanel&gt;
      &lt;DataGrid x:Name="leftPane" DockPanel.Dock="Left"&gt;
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Header="Name"/&gt;
              &lt;DataGridTextColumn Header="Age"/&gt;
          &lt;/DataGrid.Columns&gt;
      &lt;/DataGrid&gt;
      &lt;DataGrid x:Name="rightPane" DockPanel.Dock="Right"&gt;
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Header="City"/&gt;
              &lt;DataGridTextColumn Header="Population"/&gt;
          &lt;/DataGrid.Columns&gt;
      &lt;/DataGrid&gt;
  &lt;/DockPanel&gt;
  </code></pre>
  
  <p>I know I need to add "Binding" attributes to the DataGridTextColumns, and perhaps a "DataContext" to the DataGrids, but I don't know what to put in there. Most of the binding tutorials out there show how to bind to StaticResources or classes with properties, but not to the JObject hierarchies that JSON.Net deserializes to.</p>