private void trvw_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.Source is TreeViewItem treeViewItem)
{
if (e.RightButton == MouseButtonState.Pressed || e.LeftButton == MouseButtonState.Pressed)
{
treeViewItem.IsSelected = true;
}
}
}
标签:MouseButtonState,选中,Pressed,WPF,TreeView,treeViewItem
From: https://www.cnblogs.com/qq2806933146xiaobai/p/17040488.html