title: Bind WPF Extended Toolkit PropertyGrid to a dictionary or other dynamic source?
body: <p>I have an XML file with several child elements. Each child element contains a series of elements, but the XML schema is undocumented, so I cannot possibly account for every possible element name. My goal is to provide an editor view for each child element. For example:</p>
  
  <p><strong>XML File</strong></p>
  
  <pre><code>&lt;root&gt;
      &lt;element&gt;
          &lt;subelement1&gt;value&lt;/subelement&gt;
          &lt;randomName88787&gt;value&lt;/randomName&gt;
          &lt;somethingTotallyFunky&gt;value&lt;/somethingTotallyFunky&gt;
          &lt;iHaveNoIdeaWhatThisWillBe&gt;value&lt;/iHaveNoIdeaWhatThisWillBe&gt;
      &lt;/element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I was hoping to use the WPF Toolkit's PropertyGrid control (or something similar) to present a list of all child elements of <code>&lt;element&gt;</code>, but this control is designed to be bound to a CLR object. Of course I can't define a class with properties because I don't know what those properties will be. I've tried the following code to bind to an expando object:</p>
  
  <pre><code>var expando = new ExpandoObject();
  var dict = (IDictionary&lt;string, object&gt;)expando;
  foreach (var prop in unit.Elements())
  {
      if (dict.ContainsKey(prop.Name.LocalName) == false)
      {
          dict.Add(prop.Name.LocalName, (string)prop.Value);
      }
  }
  
  Properties.SelectedObject = expando;
  </code></pre>
  
  <p>But no properties are displayed. It doesn't seem to handle ExpandoObject very well. Is there a better way to approach what I'm trying to do? A better control to do it with?</p>