Esempio n. 1
0
 public override DragDropEffects InitiateDrag(IDataObject draggedData, DragDropEffects allowedEffects,
                                              LocalDragEventArgs args)
 {
     DataObject = draggedData;
     DragArgs   = args;
     EffectsIn  = allowedEffects;
     return(EffectsOut);
 }
Esempio n. 2
0
 private void OnMouseMoved(object?sender, LocalDragEventArgs e)
 {
     if (TryHandleIsMouseDownEvent(e))
     {
         return;
     }
     TryHandleDragDeltaRange(sender, e);
     SendEvent(sender, e);
 }
Esempio n. 3
0
        private bool TryHandleIsMouseDownEvent(LocalDragEventArgs e)
        {
            if (e.MessageType == MouseMessageType.Down)
            {
                mouseDownEventPendingDragActivation = e;
                return(true);
            }

            return(false);
        }
Esempio n. 4
0
        private void TryHandleDragDeltaRange(object?sender, LocalDragEventArgs e)
        {
            if (mouseDownEventPendingDragActivation == null)
            {
                return;
            }
            var offset = mouseDownEventPendingDragActivation.TransformedPoint - e.TransformedPoint;

            if (Math.Abs(offset.X) >= xTol || Math.Abs(offset.Y) >= yTol)
            {
                SendEvent(sender, mouseDownEventPendingDragActivation);
                mouseDownEventPendingDragActivation = null;
            }
        }
Esempio n. 5
0
 public override DragDropEffects InitiateDrag(IDataObject draggedData, DragDropEffects allowedEffects,
                                              LocalDragEventArgs args) => new DragHandler(this, args).InitiateDrag(draggedData, allowedEffects);
Esempio n. 6
0
 public void MouseMoved(LocalDragEventArgs e)
 {
     LastArgs = e;
 }
Esempio n. 7
0
 private void SendEvent(object?sender, LocalDragEventArgs e)
 {
     MouseMoved?.Invoke(sender, e);
 }
Esempio n. 8
0
 public abstract DragDropEffects InitiateDrag(IDataObject draggedData, DragDropEffects allowedEffects,
                                              LocalDragEventArgs args);