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

Nested Drag Source + Touch #462

Open
BButner opened this issue Dec 15, 2022 · 4 comments
Open

Nested Drag Source + Touch #462

BButner opened this issue Dec 15, 2022 · 4 comments
Labels

Comments

@BButner
Copy link

BButner commented Dec 15, 2022

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 BButner added the Bug label Dec 15, 2022
@BButner
Copy link
Author

BButner commented Dec 16, 2022

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
Copy link

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

best regards,
Ivan

@IceDiam0nd
Copy link

IceDiam0nd commented Mar 26, 2024

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

DragDropTest.zip

@Brains
Copy link

Brains commented Dec 19, 2024

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

@BButner did your workaround work well all way down to Drop moment?

Because I tried your solution with my custom TableDragHandler:

var handler = (TableDragHandler) border.FindResource("TableDragHandler");

but the next stage (that is TableDropHandler, custom as well) has received a bad data in DragOver method. 'Bad' means that CanAcceptData returns false due to dropInfo.DragInfo is null.

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

3 participants