Exemplo n.º 1
0
 private static void DragSource_PreviewMouseMove(object sender, MouseEventArgs e)
 {
     if (_isMouseDown && IsDragGesture(e.GetPosition(CurrentDragSourceAdvisor.GetTopContainer())))
     {
         DragStarted(sender as UIElement);
     }
 }
Exemplo n.º 2
0
 private static void DragSource_PreviewMouseMove(object sender, MouseEventArgs e)
 {
     if (CurrentDragSourceAdvisor != null && e.LeftButton == MouseButtonState.Pressed &&
         IsDragGesture(e.GetPosition(CurrentDragSourceAdvisor.GetTopContainer())))
     {
         DragStarted(sender as UIElement);
     }
     else
     {
         Mouse.Capture(null);
     }
 }
Exemplo n.º 3
0
        /* ____________________________________________________________________
         *		Drag Source events
         * ____________________________________________________________________
         */

        private static void DragSource_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            // Make this the new drag source
            CurrentDragSourceAdvisor = GetDragSourceAdvisor(sender as DependencyObject);

            if (CurrentDragSourceAdvisor.IsDraggable(e.Source as UIElement) == false)
            {
                return;
            }

            _draggedElt     = e.Source as UIElement;
            _dragStartPoint = e.GetPosition(CurrentDragSourceAdvisor.GetTopContainer());
            _offsetPoint    = e.GetPosition(_draggedElt);
            _isMouseDown    = true;
        }