title: WPF TreeView want to select first child when parent is selected
body: <p>I am using a presentation model to implement navigation in my app with the <code>TreeView</code> control. I have the <code>TreeViewItem</code>'s IsSelected property bound to my view model via two-way binding. When a node that has children is selected, I want the first child of that node to be selected instead of the one that is clicked. It seems like the <code>TreeViewItem</code> doesn't listen to the property changed event when it is setting the IsSelected property on my presentation model. The first child node is selected, but the parent node doesn't unselect. Here is the code from my presentation model.</p>
  
  <pre><code>public bool IsSelected {
      get {
          return this._isSelected;
      }
      set {
          if(this._isSelected != value) {
              this._isSelected = value;
              if(this.Nodes.Count &gt; 0) {
                  this._isSelected = false;
                  this.Nodes[0].IsSelected = true;
              }
              this.NotifyPropertyChanged("IsSelected");
          }
      }
  }
  </code></pre>
  
  <p>And here is the style for my <code>TreeViewItem</code>:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type TreeViewItem}"&gt;
      &lt;Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /&gt;
  &lt;/Style&gt;
  </code></pre>