public void StartDrag(DraggableItem item, int amount) { CurrentItem = item; CurrentDragAmount = amount; CurrentItem.Item.CurrentAmount -= amount; OnDragStarted.Invoke(CurrentItem, CurrentDragAmount); }
private void Ellipse_MouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { OnDragStarted?.Invoke(); } }
private void DraggableItem_OnPressed() { if (!IsDragging) { IsDragging = true; OnDragStarted.Invoke(); } }
/// <summary> /// Starts card drag. /// </summary> public void OnPointerDown(PointerEventData eventData) { if (_isPlayed == true) { // Card was already played return; } _isDragged = true; _dragOffset = transform.position - Input.mousePosition; OnDragStarted?.Invoke(this); }
private void OnItemDrag(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { if (SongList.SelectedItem != null) { OnDragStarted?.Invoke((SongList.SelectedItem as Song).ID, CurrentPlaylist.ID); DragDrop.DoDragDrop(SongList, (SongList.SelectedItem), DragDropEffects.Copy); } } }
private void Grid_MouseMove(object sender, MouseEventArgs e) { base.OnMouseMove(e); if (e.LeftButton == MouseButtonState.Pressed) { DataObject dataObject = new DataObject(); dataObject.SetData("Face", Face); DragDrop.DoDragDrop(this, dataObject, DragDropEffects.Move); OnDragStarted?.Invoke(this); OnDragStarted = null; } }
private void DragAreaTracker_MouseDown(object sender, MouseButtonEventArgs e) { mouse_down_point = e.GetPosition(canvas); button_left_pressed = e.LeftButton == MouseButtonState.Pressed; button_right_pressed = e.RightButton == MouseButtonState.Pressed; if (null == current_annotation) { canvas.CaptureMouse(); current_annotation = new DragAreaControl(visible); Canvas.SetLeft(current_annotation, mouse_down_point.X); Canvas.SetTop(current_annotation, mouse_down_point.Y); current_annotation.Width = 0; current_annotation.Height = 0; canvas.Children.Add(current_annotation); OnDragStarted?.Invoke(button_left_pressed, button_right_pressed, mouse_down_point); OnDragInProgress?.Invoke(button_left_pressed, button_right_pressed, mouse_down_point, mouse_down_point); } }
private void HandleDragStarted() { IsDragged = true; OnDragStarted?.Invoke(this); }
protected override void OnThumbDragStarted(DragStartedEventArgs e) { base.OnThumbDragStarted(e); OnDragStarted?.Invoke(this, e); }
private void ThumbOnDragStarted(object sender, DragStartedEventArgs e) { OnDragStarted?.Invoke(this, e); }
public void StartDragging() { IsDragging = true; OnDragStarted?.Invoke(); }
public void OnPointerDown(PointerEventData eventData) { dragOffset = eventData.position - new Vector2(Screen.width / 2f, Screen.height / 2f) - (Vector2)transform.localPosition; isDragging = true; OnDragStarted?.Invoke(startPointIndex, evenlySpacedPoints.Count); }