コード例 #1
0
ファイル: DragAndDropManager.cs プロジェクト: appsou/Helios
 private static void DragSource_PreviewMouseMove(object sender, MouseEventArgs e)
 {
     if (_isMouseDown && IsDragGesture(e.GetPosition(CurrentDragSourceAdvisor.GetSourceTopContainer())))
     {
         DragStarted(sender as UIElement);
     }
 }
コード例 #2
0
ファイル: DragAndDropManager.cs プロジェクト: appsou/Helios
 private static void DragSource_PreviewMouseUp(object sender, MouseButtonEventArgs e)
 {
     if (_isMouseDown && IsDragGesture(e.GetPosition(CurrentDragSourceAdvisor.GetSourceTopContainer())))
     {
         _isMouseDown = false;
         Mouse.Capture(null);
     }
 }
コード例 #3
0
ファイル: DragAndDropManager.cs プロジェクト: appsou/Helios
        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, e.GetPosition(CurrentDragSourceAdvisor.GetSourceTopContainer())))
            {
                _draggedElt     = e.Source as UIElement;
                _dragStartPoint = e.GetPosition(CurrentDragSourceAdvisor.GetSourceTopContainer());
                _offsetPoint    = e.GetPosition(_draggedElt);
                _isMouseDown    = true;
                e.Handled       = true;
            }
            e.Handled = false;
        }