title: WPF TreeView item clicked
body: <p>I am a problem with the event in WPF. Say I have a underlying data model and a tree view to present the data. The simplest thing I want to do is, when I click on one item, I would do something with underlying data associated with that item. </p>
  
  <p>I tried using the <code>MouseLeftButtonDown</code> event of the <code>Textblock</code>, but then the sender object is just the <code>Textblock</code> itself and I cannot get access to the underlying data. </p>
  
  <p>Now I also tried using the <code>MouseLeftButtonDown</code> event of the <code>TreeViewItem</code> like this:</p>
  
  <pre><code>&lt;TreeView.ItemContainerStyle&gt;
      &lt;Style TargetType="{x:Type TreeViewItem}"&gt;
           &lt;EventSetter Event="MouseLeftButtonDown" Handler="itemClicked"/&gt;
      &lt;/Style&gt;
  &lt;/TreeView.ItemContainerStyle&gt;
  </code></pre>
  
  <p>But I did not get the handler called.</p>
  
  <p>So how exactly should I do this? Is there some kind of standard approach?</p>