diff --git a/GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs b/GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs index 00630163..24c63d7f 100644 --- a/GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs +++ b/GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs @@ -19,11 +19,8 @@ protected override void OnRender(DrawingContext drawingContext) var tvItem = visualTargetItem as TreeViewItem; if (tvItem != null && VisualTreeHelper.GetChildrenCount(tvItem) > 0) { - var grid = VisualTreeHelper.GetChild(tvItem, 0) as Grid; - if (grid != null) { - var descendant = VisualTreeHelper.GetDescendantBounds(tvItem); - rect = new Rect(tvItem.TranslatePoint(new Point(), this.AdornedElement), new Size(descendant.Width + 4, tvItem.ActualHeight)); - } + var descendant = VisualTreeHelper.GetDescendantBounds(tvItem); + rect = new Rect(tvItem.TranslatePoint(new Point(), this.AdornedElement), new Size(descendant.Width + 4, tvItem.ActualHeight)); } if (rect.IsEmpty) { rect = new Rect(visualTargetItem.TranslatePoint(new Point(), this.AdornedElement), VisualTreeHelper.GetDescendantBounds(visualTargetItem).Size);