protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
 {
     base.OnMouseLeftButtonDown(e);
     EndDragOperation();
     _dragOperation = new SelectCards(this);
     e.Handled      = true;
 }
Beispiel #2
0
 protected override void OnMouseDown(MouseButtonEventArgs e)
 {
     base.OnMouseDown(e);
     if (e.MiddleButton == MouseButtonState.Pressed && _dragOperation == null)
     {
         _dragOperation = new Pan(this);
     }
 }
 private void EndDragOperation()
 {
     if (_dragOperation != null)
     {
         _dragOperation.EndDrag();
         _dragOperation = null;
     }
 }
Beispiel #4
0
 protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
 {
     base.OnPreviewMouseLeftButtonDown(e);
     if (!Keyboard.IsKeyDown(Key.Space))
     {
         return;
     }
     _dragOperation = new Pan(this);
     e.Handled      = true;
 }
Beispiel #5
0
 protected override void OnMouseUp(MouseButtonEventArgs e)
 {
     switch (e.ChangedButton)
     {
     case MouseButton.Left:
         if (_dragOperation != null)
         {
             _dragOperation.EndDrag();
             _dragOperation = null;
         }
         e.Handled = true;
         break;
     }
     base.OnMouseUp(e);
 }