title: Why e.Source depends on TreeView populating method?
body: <p>I have two trees: </p>
  
  <ol>
  <li>fooTree - made up of  elements,</li>
  <li>barTree - constructed by </li>
  </ol>
  
  <p>Both trees have MouseRightButtonDown event, but the e.Source type differs:</p>
  
  <ol>
  <li>fooTree - System.Windows.Controls.TreeViewItem</li>
  <li>barTree - System.Windows.Controls.TreeView</li>
  </ol>
  
  <p>Why e.Source differs? Also, how can I get the clicked item for the barTree?</p>
  
  <p>Markup:</p>
  
  <pre><code>    &lt;TreeView Name="fooTree" MouseRightButtonDown="fooTree_MouseDown"&gt;
          &lt;TreeViewItem Header="foo"&gt;&lt;/TreeViewItem&gt;
          &lt;TreeViewItem Header="foo"&gt;&lt;/TreeViewItem&gt;
      &lt;/TreeView&gt;
  
      &lt;TreeView Name="barTree" MouseRightButtonDown="barTree_MouseDown" ItemsSource="{Binding BarItems}"&gt;
          &lt;TreeView.ItemTemplate&gt;
              &lt;HierarchicalDataTemplate&gt;
                  &lt;TextBlock Text="{Binding}" /&gt;
              &lt;/HierarchicalDataTemplate&gt;
          &lt;/TreeView.ItemTemplate&gt;
      &lt;/TreeView&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>public partial class Window1 : Window
  {
      public Window1()
      {
          InitializeComponent();
          this.DataContext = this;
      }
  
      public string[] BarItems
      {
          get { return new string[] { "bar", "bar" }; }
      }
  
      private void barTree_MouseDown(object sender, MouseButtonEventArgs e) 
      {
      }
  
      private void fooTree_MouseDown(object sender, MouseButtonEventArgs e) 
      {
      }
  }
  </code></pre>