WPF/C# Treeview 禁用双击折叠展开

给TreeView添加PreviewMouseDoubleClick事件,并在时间内拦截事件路由即可。具体如下:

<TreeView
  PreviewMouseDoubleClick="TreeManuscript_PreviewMouseDoubleClick"/>

 

private void TreeManuscript_PreviewMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
  e.Handled = true;
}

posted @ 2020-10-20 14:44  苏秦与真相  阅读(1081)  评论(0编辑  收藏  举报