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

            return(false);
        }
Exemple #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;
            }
        }
Exemple #5
0
 public override DragDropEffects InitiateDrag(IDataObject draggedData, DragDropEffects allowedEffects,
                                              LocalDragEventArgs args) => new DragHandler(this, args).InitiateDrag(draggedData, allowedEffects);
Exemple #6
0
 public void MouseMoved(LocalDragEventArgs e)
 {
     LastArgs = e;
 }
Exemple #7
0
 private void SendEvent(object?sender, LocalDragEventArgs e)
 {
     MouseMoved?.Invoke(sender, e);
 }
Exemple #8
0
 public abstract DragDropEffects InitiateDrag(IDataObject draggedData, DragDropEffects allowedEffects,
                                              LocalDragEventArgs args);