Multi-touch screen and WPF list

I use an overlay on the cyclotouch screen and need a drag and drop movement (i.e. finger down and move) in the list item to behave the same way as drag and drop (i.e., click down, hold your finger and move). I really desperately need help on this - I can see a lot of articles about explaining how to implement the scroll response in the wpf list on the touch screen (were the elements scrolling up and down, but not moved / held to such an extent, finger), but this is the opposite of what I want.

Any help that was seriously appreciated, I was stuck with this for a while, and I don't know how to do it.

Thank you very much,

Dan

+4
source share
1 answer

I assume you are using the Surface SDK. (If not, why not?) Then this is a great resource: http://msdn.microsoft.com/en-us/library/ff727837.aspx

edit: While re-reading my question, I saw that you used Touch-overlay. Is it right that they do not trigger touch events on Windows 7, but simply simulate a mouse? If so, then I'm a little curious why drag-and-drop does not work with this, as with a normal mouse.

edit2:

So, you need to add two listeners in the datatemplate; PreviewTouchDown and PreviewTouchMove.

This is what I use to start the drag and drop operation with the mouse, but it should also work with touch, with some changes.

private void TreePreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { _startPoint = e.GetPosition(null); _checkDragDrop = true; } private void TempTreeMouseMove(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { var mousePos = e.GetPosition(null); var diff = _startPoint - mousePos; if (_checkDragDrop) { if (Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance || Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance) { _checkDragDrop = false; . . . DragDropEffects val = DragDrop.DoDragDrop(DragSourceList, dragData, DragDropEffects.Move); } } } } 

You probably can't use the Telerik class with this.

+2
source

Source: https://habr.com/ru/post/1385521/


All Articles