Exemplo n.º 1
0
        private void tryStartDrag(MouseEventArgs e, bool ignoreDistance = false)
        {
            if (!this.group && this.IsEnabled && this.isMouseDown && e.LeftButton == MouseButtonState.Pressed)
            {
                var d = e.GetPosition(null) - this.mouseDownPosition;

                if (!ignoreDistance)
                {
                    if (Math.Abs(d.X) < SystemParameters.MinimumHorizontalDragDistance ||
                        Math.Abs(d.Y) < SystemParameters.MinimumVerticalDragDistance)
                    {
                        return;
                    }
                }

                this.EntryBackColor = this.entryHoverColor;
                this.dragging       = true;
                TimeEntryCellDragImposter.Start(this);
                DragDrop.DoDragDrop(this, new DataObject("time-entry-cell", this), DragDropEffects.Move);
                TimeEntryCellDragImposter.Stop();
                this.dragging       = false;
                this.EntryBackColor = idleBackColor;

                e.Handled = true;
            }

            this.isMouseDown = false;
        }
Exemplo n.º 2
0
 protected override void OnGiveFeedback(GiveFeedbackEventArgs e)
 {
     TimeEntryCellDragImposter.Update();
 }