title: WPF MVVM TreeView IsSelected binding not working
body: <p>I have a problem that I cannot see why it's not working.
  I have a 3 level Treeview with a converter which allow me to invert the two first level.
  On this TreeView I'm trying to bing the IsSelected Property but for a reason I don't understand it is never call in the ViewModel. </p>
  
  <p>Here is the xaml.</p>
  
  <pre><code>&lt;TreeView  Margin="0,0,0,0" Padding="0,7,0,7" BorderBrush="{x:Null}"  Background="#FFF8FAFB" Name="BusinessCaseTreeView"&gt;
      &lt;TreeView.ItemContainerStyle&gt;
          &lt;Style TargetType="{x:Type TreeViewItem}"&gt;
              &lt;Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /&gt;
          &lt;/Style&gt;
      &lt;/TreeView.ItemContainerStyle&gt;
      &lt;TreeView.ItemsSource&gt;
          &lt;MultiBinding Converter="{converter:BusinessCasesConverter}"&gt;
              &lt;Binding Path="BusinessCases"&gt;&lt;/Binding&gt;
              &lt;Binding Path="GroupByCreditor"&gt;&lt;/Binding&gt;
          &lt;/MultiBinding&gt;
      &lt;/TreeView.ItemsSource&gt;
      &lt;TreeView.Resources&gt;
          &lt;HierarchicalDataTemplate DataType="{x:Type converter:BusinessCaseTreeViewableFirst}" ItemsSource="{Binding SecondLevel}"&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;TextBlock Text="{Binding FirstLevel.Id}" Margin="10,0,0,0" Foreground="#FF03577A" FontWeight="Bold" /&gt;
                  &lt;TextBlock Text="-" Margin="5,0,0,0" Foreground="#FF03577A" FontWeight="Bold"/&gt;
                  &lt;TextBlock Text="{Binding FirstLevel.FirstName}" Margin="5,0,0,0" FontWeight="Bold" Foreground="#FF03577A" /&gt;
                  &lt;TextBlock Text="{Binding FirstLevel.LastName}" Margin="5,0,0,0" FontWeight="Bold" Foreground="#FF03577A" /&gt;
              &lt;/StackPanel&gt;
          &lt;/HierarchicalDataTemplate&gt;
          &lt;HierarchicalDataTemplate DataType="{x:Type converter:BusinessCaseTreeViewModelSecond}" ItemsSource="{Binding  BusinessCases}"&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;TextBlock Text="{Binding SecondLevel.Id}" Margin="10,0,0,0" Foreground="#FF095A7C" FontWeight="Bold" /&gt;
                  &lt;TextBlock Text="-" Margin="5,0,0,0" Foreground="#FF095A7C" FontWeight="Bold"/&gt;
                  &lt;TextBlock Text="{Binding SecondLevel.FirstName}" Margin="5,0,0,0" FontWeight="Bold" Foreground="#FF095A7C" /&gt;
                  &lt;TextBlock Text="{Binding SecondLevel.LastName}" Margin="5,0,0,0" FontWeight="Bold" Foreground="#FF095A7C" /&gt;
              &lt;/StackPanel&gt;
          &lt;/HierarchicalDataTemplate&gt;
          &lt;DataTemplate DataType="{x:Type business:BusinessCase}"&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;TextBlock Text="(" Margin="10,0,0,0" Foreground="#FF0B89BD" FontWeight="Bold" /&gt;
                  &lt;TextBlock Text="{Binding Id}" Margin="1,0,0,0" Foreground="#FF0B89BD" FontWeight="Bold" /&gt;
                  &lt;TextBlock Text=")" Margin="2,0,0,0" Foreground="#FF0B89BD" FontWeight="Bold"/&gt;
                  &lt;TextBlock Text="{Binding CreationDate, StringFormat='{}{0:dd MMMM yyyy}'}" Margin="5,0,0,0" Foreground="#FF0B89BD" /&gt;
                  &lt;TextBlock Text="-" Margin="5,0,0,0" Foreground="#FF0B89BD" FontWeight="Bold"/&gt;
                  &lt;TextBlock Text="{Binding ClosureDate, StringFormat={}{0:dd MMMM yyyy}}" Margin="5,0,0,0" Foreground="#FF0B89BD" /&gt;
              &lt;/StackPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/TreeView.Resources&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>I never arrive on the IsSelected setter in my ViewModel. If you have any idea, there are welcomed.</p>
  
  <p>Thanks in advance</p>