WPF的Treeview要写一个TreeviewItem.Selected事件,这个事件只是对TreeviewItem.IsSelected的变化有响应。
<TreeView Margin="0,0,0,0" Name="tvArea" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TreeViewItem.Selected="tvArea_Selected" />
//AreaTreeNode:TreeViewItem
//其中Header是一个CheckBox控件
private void chkBox_Click(object sender, RoutedEventArgs e)
{
//this.OnSelected(e);
this.IsSelected = true;
}