I have a listview where I have templated the column headers and the listview items are templated also. However I have different tempalates for some of the rows in the grid
Yes, set up a double-click handler on the ListView itself. Then in the handler, use code like this:
private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (TryFindParent(e.OriginalSource as DependencyObject) != null)
e.Handled = true;
}
Where TryFindParent is defined as:
public static T TryFindParent(DependencyObject current) where T : class
{
DependencyObject parent = VisualTreeHelper.GetParent(current);
if (parent == null) return null;
if (parent is T) return parent as T;
else return TryFindParent(parent);
}