How to capture Left Mouse Click on TreeView item control in WPF?
Use ItemContainerStyle and EventSetter
Example:
XAML
<TreeView x:Name="tvMain>
<TreeView.ItemContainerStyle><Style TargetType="{x:Type TreeViewItem}">
<EventSetter Event="MouseLeftButtonUp" Handler="treeViewItem_MouseLeftButtonUp"/>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
c# Code:
private void treeViewItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
TreeViewItem tvi = (TreeViewItem)sender;
e.Handled = true;
}