title: Click on ListBox with DataTemplate, select ListBox Item
body: <p>When you click on a control inside the <code>ListBox</code> (its <code>DataTemplate</code>), I want to know which item that is so that I can select that item.</p>
  
  <p>I have a WPF application with a <code>ListBox</code>.  Using a <code>DataTemplate</code>, I have a <code>TextBlock</code> and a <code>Textbox</code> inside it.</p>
  
  <pre><code>&lt;ListBox PreviewMouseLeftButtonDown="myHandler"&gt;
    &lt;ListBox.ItemTemplate&gt;
      &lt;DataTemplate&gt;
        &lt;StackPanel&gt;
          &lt;TextBlock /&gt;
          &lt;TextBox /&gt;
        &lt;/StackPanel&gt;
      &lt;/DataTemplate&gt;
    &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>Right now, if you click on the TextBlock, it selects the overall item.  But if you click inside the TextBox (to repeat: Box, not Block), it doesn't select the item.</p>
  
  <p>Is there code that I can put inside the ListBox's PreviewMouseLeftButtonDown that can tell me the index of the ListBoxItem whose TextBox I clicked?  Or some other way to select the ListBoxItem?</p>