I need my app to perform a certain action when DataGrid is double clicked. The action should not be performed if a scrollbar is doubleclicked. So I try to see what is doubleclicked:
private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
Point p = Mouse.GetPosition(this.DataGrid1);
IInputElement ie = this.DataGrid1.InputHitTest(p);
}
But when I doubleclick a scrollbar, then IInputElement appears to be all sort of stuff: Microsoft.Windows.Themes.ScrollChrome or System.Windows.Shapes.Rectangle . So I am not sure if I clicked a scrollbar.
So how do I check if I really doubleclicked a scrollbar?