punker76 / gong-wpf-dragdrop

The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
BSD 3-Clause "New" or "Revised" License
2.23k stars 390 forks source link

Nested Drag Source + Touch #462

Open BButner opened 1 year ago

BButner commented 1 year ago

Describe the bug I have a <ListView> as a Drop Target. Inside of the list view collection, I have a specific <Thumb> that is used as the Drag Source. When using the mouse it works perfectly. However, when using touch, it ends up scrolling the Scroll View, instead of grabbing the Drag Source.

To Reproduce Steps to reproduce the behavior:

  1. Create a <ListView> as a Drop Target
  2. Create a ListViewItem Template that contains the Drag Source
  3. Attempt to use a Touch Screen to grab the Drag Source
  4. See that it starts to scroll, instead of dragging

Expected behavior It should grab the Drag Source

Desktop (please complete the following information):

BButner commented 1 year ago

I'm able to somewhat work around this and accomplish what I want with:

private void UIElement_OnTouchDown( object sender, TouchEventArgs e )
{
    if( sender is not Thumb thumb ) return;

    DragDrop.DefaultDragHandler.StartDrag( new DragInfo( thumb, e )
    {
        Effects = DragDropEffects.Move, Data = thumb.DataContext
    } );

    e.Handled = true;
}
IceDiam0nd commented 3 months ago

I got the same issue, is there something new for this bug?

best regards, Ivan

IceDiam0nd commented 3 months ago

I attached my test project, please try it with touch screen.

DragDropTest.zip