/// <summary> /// Starts dragging, and invokes the StartMoving event. /// </summary> /// <param name="args">Mouse event arguments.</param> protected override void OnMouseDown(MouseEventArgs args) { if (args.Button == MouseButtons.Left) { this.isDragging = true; this.lastLocation = args.Position; if (StartMoving != null) { StartMoving.Invoke(this); } } }
private void OnStartMoving() { StartMoving?.Invoke(this, new EventArgs()); }
protected virtual void OnStartMoving(IntPtr handle) { System.Diagnostics.Debug.WriteLine($"Start moving"); _state = State.Moving; StartMoving?.Invoke(this, handle); }