Esempio n. 1
0
 private void PreviewMouseMove(object sender, MouseEventArgs e)
 {
     if (_draggedData != null)
     {
         // Only drag when user moved the mouse by a reasonable amount.
         if (IsMovementBigEnough(_initialMousePosition, e.GetPosition(_topWindow)))
         {
             var draggingItem = new CanDragItemEventArgs(_sourceItemContainer);
             _source.RaiseEvent(draggingItem);
             if (draggingItem.CanDrag)
             {
                 ItemsControlDragDrop.Instance.StartDragDrop(_source, _sourceItemContainer, _draggedData, _initialMousePosition);
                 _draggedData = null;
             }
         }
     }
 }
Esempio n. 2
0
 private void PreviewMouseMove(object sender, MouseEventArgs e)
 {
     if (_draggedData != null)
     {
         // Only drag when user moved the mouse by a reasonable amount.
         if (IsMovementBigEnough(_initialMousePosition, e.GetPosition(_topWindow)))
         {
             var draggingItem = new CanDragItemEventArgs(_sourceItemContainer);
             _source.RaiseEvent(draggingItem);
             if (draggingItem.CanDrag)
             {
                 ItemsControlDragDrop.Instance.StartDragDrop(_source, _sourceItemContainer, _draggedData, _initialMousePosition);
                 _draggedData = null;
             }
         }
     }
 }
Esempio n. 3
0
 private void ListBox_OnCanDragItem(object sender, CanDragItemEventArgs e)
 {
     e.CanDrag = ((WordSegmentViewModel) e.ItemContainer.DataContext).IsBoundary;
     e.Handled = true;
 }