Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GongSolutions.Wpf.DragDrop/DragDrop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ private static void DropTarget_PreviewDragOver(object sender, DragEventArgs e)
var adornedElement =
itemsControl is TabControl
? itemsControl.GetVisualDescendent<TabPanel>()
: (itemsControl.GetVisualDescendent<ItemsPresenter>() ?? itemsControl.GetVisualDescendent<ScrollContentPresenter>() as UIElement);
: (itemsControl.GetVisualDescendent<ItemsPresenter>() ?? itemsControl.GetVisualDescendent<ScrollContentPresenter>() as UIElement ?? itemsControl);

if (adornedElement != null) {
if (dropInfo.DropTargetAdorner == null) {
Expand Down
6 changes: 4 additions & 2 deletions GongSolutions.Wpf.DragDrop/DropInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ public DropInfo(object sender, DragEventArgs e, DragInfo dragInfo)
this.InsertPosition |= RelativeInsertPosition.TargetItemCenter;
}
//System.Diagnostics.Debug.WriteLine("==> DropInfo: InsPos={0}, InsIndex={1}, X={2}, Item={3}", this.InsertPosition, this.InsertIndex, currentXPos, item);
}
}
}
else
{
this.TargetCollection = itemsControl.ItemsSource ?? itemsControl.Items;
this.InsertIndex = itemsControl.Items.Count;
//System.Diagnostics.Debug.WriteLine("==> DropInfo: {0}, item=NULL, {1}", this.InsertPosition, this.InsertIndex);
}
} else {
this.VisualTargetItem = this.VisualTarget;
}
}

Expand Down Expand Up @@ -344,4 +346,4 @@ public enum RelativeInsertPosition
AfterTargetItem = 1,
TargetItemCenter = 2
}
}
}