title: WPF XAML Datagrid XML File Binding with XElement, XML File Loaded in codebehind
body: <p>Here we go again kids, yet another camper lost in the woods around WPF Databinding.  Its been a fruitful day of climbing the databinding inverted ice wall, but I'm at my wits end with this.  No examples I find or amount of SNOOP'ing is helping me find my issue.  Hopefully some databinding rock star, all three of you, can help a brotha out!  :)</p>
  
  <p><strong>XML File</strong> - The faces and names have been changed to protect the innocent</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;Mappings&gt;
    &lt;Mapping&gt;
      &lt;Class1&gt;WonderBread&lt;/Class1&gt;
      &lt;Class2&gt;Tortilla&lt;/Class2&gt;
      &lt;Properties&gt;
        &lt;Property&gt;
          &lt;Jx&gt;name&lt;/Jx&gt;
          &lt;Dyn&gt;Name&lt;/Dyn&gt;
          &lt;Create&gt;1&lt;/Create&gt;
          &lt;Update&gt;0&lt;/Update&gt;
        &lt;/Property&gt;
        &lt;Property&gt;
          &lt;Jx&gt;Juice&lt;/Jx&gt;
          &lt;Dyn&gt;Juice&lt;/Dyn&gt;
          &lt;Create&gt;1&lt;/Create&gt;
          &lt;Update&gt;0&lt;/Update&gt;
        &lt;/Property&gt;
        &lt;Property&gt;
          &lt;Jx&gt;Fred&lt;/Jx&gt;
          &lt;Dyn&gt;Fred&lt;/Dyn&gt;
          &lt;Create&gt;1&lt;/Create&gt;
          &lt;Update&gt;0&lt;/Update&gt;
        &lt;/Property&gt;
        &lt;Property&gt;
          &lt;Jx&gt;Love&lt;/Jx&gt;
          &lt;Dyn&gt;Love&lt;/Dyn&gt;
          &lt;Create&gt;1&lt;/Create&gt;
          &lt;Update&gt;0&lt;/Update&gt;
        &lt;/Property&gt;
      &lt;/Properties&gt;
    &lt;/Mapping&gt;
  &lt;/Mappings&gt;
  </code></pre>
  
  <p><strong>How I load this XML File</strong> and set it into my datagrids DataContext. Done in the constructor.  This loads correctly, via SNOOP I can see the XML file in the DataContext.  </p>
  
  <pre><code>    // load the ObjectMappingXML file and set as Gridview Context
      XEClassMappings = XElement.Load(ConfigurationManager.AppSettings["ClassMappingXML"]);
      dgMapping.DataContext = XEClassMappings;
  </code></pre>
  
  <p><strong>XAML code to display the content</strong></p>
  
  <pre><code>        &lt;DataGrid x:Name="dgMapping" ItemsSource="{Binding Path=Elements[Property]}" Height="569"&gt;
              &lt;DataGrid.Columns &gt;
                  &lt;DataGridTextColumn Header="JxAPI Prop" Binding="{Binding Path=Element[Jx].Value}"/&gt;
                  &lt;DataGridTextColumn Header="Dyn Prop" Binding="{Binding Path=Element[Dyn].Value}"/&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
  </code></pre>
  
  <p>What in the name of all that is holy am I missing?  8hrs of hopeful F5s has left me at wits end... </p>