Skip to content
Merged
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
8 changes: 4 additions & 4 deletions GongSolutions.Wpf.DragDrop/DragDrop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ private static void IsDropTargetChanged(DependencyObject d, DependencyPropertyCh
}
}

private static void CreateDragAdorner()
private static void CreateDragAdorner(DropInfo dropInfo)
{
var template = GetDragAdornerTemplate(m_DragInfo.VisualSource);
var templateSelector = GetDragAdornerTemplateSelector(m_DragInfo.VisualSource);
Expand Down Expand Up @@ -499,7 +499,7 @@ private static void CreateDragAdorner()
adornment.Opacity = GetDefaultDragAdornerOpacity(m_DragInfo.VisualSource);
}

var rootElement = RootElementFinder.FindRoot(m_DragInfo.VisualSource);
var rootElement = RootElementFinder.FindRoot(dropInfo.VisualTarget ?? m_DragInfo.VisualSource);
DragAdorner = new DragAdorner(rootElement, adornment);
}
}
Expand Down Expand Up @@ -542,7 +542,7 @@ private static void CreateEffectAdorner(DropInfo dropInfo)
var template = GetEffectAdornerTemplate(m_DragInfo.VisualSource, dropInfo.Effects, dropInfo.DestinationText);

if (template != null) {
var rootElement = RootElementFinder.FindRoot(m_DragInfo.VisualSource);
var rootElement = RootElementFinder.FindRoot(dropInfo.VisualTarget ?? m_DragInfo.VisualSource);

var adornment = new ContentPresenter();
adornment.Content = m_DragInfo.Data;
Expand Down Expand Up @@ -869,7 +869,7 @@ private static void DropTarget_PreviewDragOver(object sender, DragEventArgs e)
dropHandler.DragOver(dropInfo);

if (DragAdorner == null && m_DragInfo != null) {
CreateDragAdorner();
CreateDragAdorner(dropInfo);
}

if (DragAdorner != null) {
Expand Down