title: How to enable a button when a treeview-item has selected?
body: <p>I have a treeview and a button.</p>
  
  <p>I want to disable the button (IsEnabled=false) when there is NO item selected in the treeview (and I want to enable the button when there is an item selected...).</p>
  
  <p>How can I do this?</p>
  
  <p>Here is my XAML:</p>
  
  <pre><code>  &lt;Window
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
      x:Class="WpfApplicationTreeViewTest.MainWindow"
      x:Name="Window"
      Title="MainWindow"
      Width="640" Height="480" WindowStartupLocation="CenterScreen" Margin="40" &gt;
      &lt;StackPanel&gt; 
          &lt;TreeView x:Name="strategyTreeView" Margin="10 40 10 10"&gt;       
              &lt;TreeViewItem Header="Test"&gt;&lt;/TreeViewItem&gt; 
              &lt;TreeViewItem Header="Test"&gt;&lt;/TreeViewItem&gt; 
              &lt;TreeViewItem Header="Test"&gt;&lt;/TreeViewItem&gt; 
              &lt;TreeViewItem Header="Test"&gt;&lt;/TreeViewItem&gt; 
          &lt;/TreeView&gt;     
          &lt;Button Name="Panel" Content="Selected" Height="40" Width="100" Margin="10"/&gt;   
      &lt;/StackPanel&gt;       
  &lt;/Window&gt;
  </code></pre>