title: How to deselect the selected item in tree view
body: <p>I am developing a WPF application, where user has the option to navigate between the pages by clicking next / previous button or by selecting a particular page in the tree view. </p>
  
  <pre><code>&lt;TreeView Background="Transparent" Cursor="Hand" ItemsSource="{Binding Path=TreeItems}" local:TreeViewExtensions.SelectedItemChanged="{Binding Path=SelectedItemChangedCommand}" ItemContainerStyle="{StaticResource TreeViewItemStyle}" &gt;
       &lt;TreeView.ItemTemplate&gt;
            &lt;DataTemplate&gt;
                 &lt;TextBlock Text="{Binding DisplayName}" /&gt;
            &lt;/DataTemplate&gt;
       &lt;/TreeView.ItemTemplate&gt;
  &lt;/TreeView&gt;
  &lt;Button Content="&amp;lt; Prev" Name="btnPrev" Command="{Binding Path=MovePreviousCommand}"/&gt;
  &lt;Button Content="Next &amp;gt;" Name="btnNext" Command="{Binding Path=MoveNextCommand}"/&gt;
  </code></pre>
  
  <p>Now the problem is, when a user clicks on a particular page name, application will navigate to particular page. If the user clicks next or previous it be navigated to next or previous page. In this scenario if user clicks on the previously selected item of treeview, it will not navigate to that particular page as it is already selected. </p>
  
  <p>Can anyone let me know, how to deselect the selected item of tree view when user clicks on 'Next' or 'Prev' button.</p>