title: WPF Dynamic Binding
body: <p>Today, I was working on a WPF UserControl to display the current value of a few variables.  I was wondering if there would be a way to make a super simple property grid in WPF.  The problem is on the starred line of the XAML below.  <strong>How would I bind a string to a property with an ItemTemplate like I have setup below?</strong>  To be more clear can I embed bindings inside of one another <code>{Binding Path={Binding Value}}</code>.</p>
  
  <p>Here is the class:</p>
  
  <pre><code>public class Food
  {
      public string Apple { get; set; }
      public string Orange { get; set; }
      public IEnumerable&lt;KeyValuePair&lt;string, string&gt;&gt; Fields
      {
          get
          {
              yield return new KeyValuePair&lt;string, string&gt;("Apple Label", "Apple");
              yield return new KeyValuePair&lt;string, string&gt;("Orange Label", "Orange");
          }
      }
  }
  </code></pre>
  
  <p>And here is the XAML:</p>
  
  <pre><code>&lt;UserControl x:Class="MAAD.Plugins.FRACTIL.Simulation.SimulationStateView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Height="331" Width="553"&gt;
   &lt;ListView ItemSource="{Binding Fields}"&gt;
    &lt;ListView.ItemTemplate&gt;
     &lt;DataTemplate&gt;
      &lt;StackPanel Orientation="Horizontal"&gt;
       &lt;TextBlock Text="{Binding Key}" /&gt;
       **&lt;TextBlock Text="{Binding Path={Binding Value}}" /&gt;**
      &lt;/StackPanel&gt;
     &lt;/DataTemplate&gt;
    &lt;/ListView.ItemTemplate&gt;
   &lt;/ListView&gt;
  &lt;/UserControl&gt;
  </code></pre>