gong-wpf-dragdrop icon indicating copy to clipboard operation
gong-wpf-dragdrop copied to clipboard

Nested Drag Source + Touch

Open BButner opened this issue 2 years ago • 3 comments

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):

  • OS: Windows 10

BButner avatar Dec 15 '22 22:12 BButner

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;
}

BButner avatar Dec 16 '22 17:12 BButner

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

best regards, Ivan

IceDiam0nd avatar Mar 22 '24 10:03 IceDiam0nd

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

DragDropTest.zip

IceDiam0nd avatar Mar 26 '24 03:03 IceDiam0nd