TouchMode and Drag/Drop

1 posts, 0 answers
  1. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 15 Jan 2014 Link to this post


    Hi,

    On my application, I'm using a GridView to display some data that I want to drag and drop to ListBox.
    The drag and drop operations works fine but when I activated the Windows8Touch theme, I see some problems:
    1) I see 1 or two circles when I keep the mouse pressed (or when the user touch the GridView): how can I remove this circles ?
    2) To initiate my drag and drop to Listbox, I use the TouchMove event with this code:

    var point = e.GetTouchPoint(datagrid).Position;
    var element = datagrid.InputHitTest(pointas FrameworkElement;
    if (element != null)
    {
        var clientVm = element.DataContext as ClientViewModel;
        if (clientVm != null)
        {
            datagrid.CaptureTouch(e.TouchDevice);
     
            DragDropEffects dropEffect = DragDrop.DoDragDrop(datagridclientVmDragDropEffects.Move);
        }
    }


    On the touch move, i get the item under the touch point and I initiate my drag/drop. I do this because, otherwise, I need to select an item to be able to drop it (and I dont want to select an item, I just want to drag/drop the item I want).
    But with that code, I'm no longer able to use the touch event to scroll on the GridView (as soon as I try, the component think I want to perform a Drag/drop operation).

    How to solve this 2 problems ?

    Thanks!
Back to Top