Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging an item over a nested ListView which is not a DropTarget will use it as target instead of parent #244

Closed
Mertsch opened this issue Apr 28, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@Mertsch
Copy link

Mertsch commented Apr 28, 2017

Repo:

  1. Run Showcase.WPF.DragDrop.NET45 from https://github.com/Mertsch/gong-wpf-dragdrop

  2. Select "Fixed #Issues"

  3. Select Library throws "The specified Visual is not an ancestor of this Visual" #146

  4. Drag and Drop an item from left to right

  5. Select Dragging an item over a nested ListView which is not a DropTarget will use it as target instead of parent #244

  6. Try to Drop an item from the left side onto the right side
    it only works when dropping onto the "Root" item
    Expected: It should also work on the inner "Item" box, as it is not marked as DropTarget and thus be ignored

punker76 added a commit that referenced this issue Jul 6, 2017
@punker76 punker76 self-assigned this Nov 5, 2017
@punker76 punker76 added the Bug label Nov 5, 2017
@punker76 punker76 added this to the v1.2.0 milestone Nov 5, 2017
punker76 added a commit that referenced this issue Nov 5, 2017
…pTarget

  The VisualTargetItem and TargetItem was not set after searching with GetItemContainerAt
@Mertsch
Copy link
Author

Mertsch commented Nov 6, 2017

@punker76 I am having some issues while verifying the fix, I can't point a finger on something specific, yet but it seems there is an issue with <UniformGrid/>

I have a ListView with an UniformGrid as ItemsPanel which leads to a horizontal first, then vertical layout. When there are no nested items the position is calculated perfectly and Drop targets the correct element.
When I Drag over the nested ListView with <StackPanel VerticalAlignment="Bottom"/>, which should be ignored, the target calculation for the UniformGrid is confused and DnD does not work or the target is a different item then the one dragged over.

@punker76 Have an idea what might be the cause?

@punker76
Copy link
Owner

punker76 commented Nov 6, 2017

@Mertsch That's really a special thing. Seems like you must implement your own DropTargetAdorner which handles the insertion (highlighting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants