Exemplo n.º 1
0
        /// <summary>
        /// Gets invoked when drag helper detects that a drag source has been dragged far enough
        /// for drag operation to initiate. If this method is overriden, deriving class must ensure
        /// that base implementation is invoked.
        /// </summary>
        protected virtual void DoDragDrop()
        {
            var eventArgs = new QueryDragDataEventArgs(_clickPoint);

            OnQueryDragData(eventArgs);

            if (eventArgs.IsCancelled || eventArgs.DragData == null)
            {
                return;
            }

            OnDragStarted(eventArgs.DragData);

            _adorner = new DragDropAdorner(_dragSource, _clickPoint);

            DragDropEffects result = DragDrop.DoDragDrop(
                _dragSource, eventArgs.DragData, DragDropEffects.Move | DragDropEffects.Link);

            _adorner.RemoveAdorner();
            _adorner = null;

            OnDragComplete(eventArgs.DragData, result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets invoked when drag helper detects that a drag source has been dragged far enough
        /// for drag operation to initiate. If this method is overriden, deriving class must ensure
        /// that base implementation is invoked.
        /// </summary>
        protected virtual void DoDragDrop()
        {
            var eventArgs = new QueryDragDataEventArgs( _clickPoint );

            OnQueryDragData( eventArgs );

            if( eventArgs.IsCancelled || eventArgs.DragData == null ) return;

            OnDragStarted( eventArgs.DragData );

            _adorner = new DragDropAdorner( _dragSource, _clickPoint );

            DragDropEffects result = DragDrop.DoDragDrop(
                    _dragSource, eventArgs.DragData, DragDropEffects.Move | DragDropEffects.Link );

            _adorner.RemoveAdorner();
            _adorner = null;

            OnDragComplete( eventArgs.DragData, result );
        }