Skip to content

Commit 3833810

Browse files
committed
safer walking of ancestory for #234
1 parent 04ed451 commit 3833810

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

MaterialDesignThemes.Wpf/DataGridAssist.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Windows.Data;
66
using System.Windows.Input;
77
using System.Windows.Media;
8+
using System.Windows.Media.Media3D;
89
using System.Windows.Threading;
910

1011
namespace MaterialDesignThemes.Wpf
@@ -191,7 +192,9 @@ private static void DataGridOnPreviewMouseLeftButtonDown(object sender,
191192
return;
192193
}
193194

194-
inputHitTest = VisualTreeHelper.GetParent(inputHitTest);
195+
inputHitTest = (inputHitTest is Visual || inputHitTest is Visual3D)
196+
? VisualTreeHelper.GetParent(inputHitTest)
197+
: null;
195198
}
196199
}
197200

0 commit comments

Comments
 (0)