title: Mousebinding in a WPF TreeView
body: <p>Is there a way to do a Mouse- or KeyBinding in a WPF treeview?</p>
  
  <pre><code>&lt;TreeView ItemsSource="{Binding Main.TreeItems}"&gt;
      &lt;TreeView.ItemTemplate&gt;                           
          &lt;HierarchicalDataTemplate ItemsSource="{Binding Path=Children}"&gt;                          
              &lt;TextBlock Text="{Binding Path=Header}"&gt;
                  &lt;TextBlock.InputBindings&gt;
                      &lt;MouseBinding Command="{Binding TreeViewClickCommand}" MouseAction="LeftDoubleClick"/&gt;
                  &lt;/TextBlock.InputBindings&gt;
               &lt;/TextBlock&gt;
          &lt;/HierarchicalDataTemplate&gt;
      &lt;/TreeView.ItemTemplate&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>This doesn't work. If i use my Command on a button not in the treeview then the command is fired. How can i solve this problem?</p>