当我选择了treeviewitem时。当用户第二次点击选定的treeviewitem但第二次没有激活项目时,wpf中该问题的解决方案是什么
XAML
<TreeViewItem Header="Company" Margin="2" Foreground="Black" Selected="TreeViewItem_Selected"/>
C#
private void btnexit_Click(object sender, RoutedEventArgs e)
{
this.Close();
TreeViewItem tvi = new TreeViewItem();
tvi.IsSelected = false;
tvi.Focus();
}