You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a ViewModel class A and implement IDragSource
Create a ViewModel class B and implement IDropTarget
Create two ListBox (named LBA and LBB).
Set the datacontext of LBA to a viewModel instance of type A.
Set the datacontext of LBB to a viewmodel instance of type B
Set the IsDragSource and DragHandler to LBA
Set the IsDropTarget and DropHandler to LBB
Try to move items from LBA to LBB
What is the expected output? What do you see instead?
I would like the Dropped function on my view model A to be called when a drop occurs
Instead of the one ine the DefaultDragHandler
What version of the product are you using? On what operating system?
Last one, Windows 7
Please provide any additional information below.
Looking at the code, it seems that the issue came from
file: DragDrop.cs
function: static void DropTarget_PreviewDrop(object sender, DragEventArgs e)
Line: IDragSource dragHandler = GetDragHandler((UIElement)sender) ?? DefaultDragHandler;
We are getting the DragSource of the sender uiElement which is the target one (i.e. LBB)
I fixed it by replacing the line with this one:
IDragSource dragHandler = GetDragHandler(_DragInfo.VisualSource) ?? DefaultDragHandler;
Original author: braul...@gmail.com (November 15, 2012 23:44:01)
What steps will reproduce the problem?
What is the expected output? What do you see instead?
I would like the Dropped function on my view model A to be called when a drop occurs
Instead of the one ine the DefaultDragHandler
What version of the product are you using? On what operating system?
Last one, Windows 7
Please provide any additional information below.
Looking at the code, it seems that the issue came from
file: DragDrop.cs
function: static void DropTarget_PreviewDrop(object sender, DragEventArgs e)
Line: IDragSource dragHandler = GetDragHandler((UIElement)sender) ?? DefaultDragHandler;
We are getting the DragSource of the sender uiElement which is the target one (i.e. LBB)
I fixed it by replacing the line with this one:
IDragSource dragHandler = GetDragHandler(_DragInfo.VisualSource) ?? DefaultDragHandler;
Original issue: http://code.google.com/p/gong-wpf-dragdrop/issues/detail?id=49
The text was updated successfully, but these errors were encountered: