title: WPF: Update a label in a listbox item
body: <p>I have a <code>ListBox</code> where the number of items is added based on and integer property set by a user. The items are created from a <code>ControlTemplate</code> resource that which is comprised of a Label and a <code>TextBox</code> inside of a <code>DockPanel</code>. The label is not data bound but I would like for it to have somewhat dynamic content based on the (index + 1) of the <code>ListboxItem</code> for which it is contained. My question/problem is that I want to be able update the content of the label for each <code>ListboxItem</code>, but cannot access the label for some reason. I am unaware of any way to do this through data-binding of the label since the label is in a template and has no knowledge that it has a parent that is a <code>ListboxItem</code>. Can anyone help me clear up some of these confusions to get me back on the right track, please?</p>
  
  <pre><code>&lt;ControlTemplate TargetType="{x:Type ListBoxItem}"&gt;
      &lt;DockPanel Background="Transparent" Height="28" Name="playerDockPanel" VerticalAlignment="Bottom"&gt;
          &lt;Label Name="playerNameLabel" DockPanel.Dock="Left" Content="Player"&gt;&lt;/Label&gt;
          &lt;TextBox Height="23" Width ="150" Name="playerName" DockPanel.Dock="Right"/&gt;
      &lt;/DockPanel&gt;
  &lt;/ControlTemplate&gt;
  </code></pre>
  
  <p>I would like to be able to bind the content of the <code>Label</code> in xaml, or update the content of the <code>Label</code> in the code behind. I'm not sure what the best route would be.</p>