我正在开发WPF应用程序,其中用户可以通过单击下一个/上一个按钮或通过在树视图中选择特定页面来在页面之间导航。如何在树状视图中取消选择所选项目
<TreeView Background="Transparent" Cursor="Hand" ItemsSource="{Binding Path=TreeItems}" local:TreeViewExtensions.SelectedItemChanged="{Binding Path=SelectedItemChangedCommand}" ItemContainerStyle="{StaticResource TreeViewItemStyle}" >
<TreeView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayName}" />
</DataTemplate>
</TreeView.ItemTemplate>
</TreeView>
<Button Content="< Prev" Name="btnPrev" Command="{Binding Path=MovePreviousCommand}"/>
<Button Content="Next >" Name="btnNext" Command="{Binding Path=MoveNextCommand}"/>
现在的问题是,当用户点击一个特定的页面名称,应用程序将导航到特定页面。如果用户点击下一页或上一页,则会导航到下一页或上一页。在这种情况下,如果用户点击之前选择的树形视图项目,它将不会导航到该特定页面,因为它已被选中。
任何人都可以让我知道,当用户点击'Next'或'Prev'按钮时,如何取消选择树形视图的选定项目。