ClassRadDragDropService
Represents a service that manages drag and drop operations with visual feedback, cursor management, and event handling.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class RadDragDropService : RadService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener
Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropService
Derived Classes:
Implements:
Inherited Members
Constructors
RadDragDropService()
Initializes a new instance of the RadDragDropService class.
Declaration
public RadDragDropService()
Remarks
Sets up default cursors, hint window configuration, and initializes the service with default drag and drop behavior settings.
Fields
Properties
CanCommit
Determines whether a drop operation will be committed (a valid drop target is found).
DropLocation
Gets the current drop location in the context of the current target.
DropTarget
Gets current drop target, where the mouse cursor points.
HintWindow
Gets the Hint window.
Declaration
protected RadLayeredWindow HintWindow { get; }
Property Value
The hint window.
InvalidCursor
Gets or sets the cursor to be used when a valid drop target is hit-tested.
UseDefaultPreview
Determines whether a default preview is generated for a ISupportDrag instance if its GetPreview method returns null.
ValidCursor
Gets or sets the cursor to be used when a valid drop target is hit-tested.
Methods
BeginDrag(Point, ISupportDrag)
Begins a drag pass. Allows for service automation.
Declaration
public void BeginDrag(Point mouseBeginPoint, ISupportDrag draggedObject)
Parameters
mouseBeginPoint
The position of the mouse cursor in screen coordinates.
draggedObject
An instance of IDraggable that is dragged.
CanStart(object)
Determines whether the service may be started. Validation is as follows:
- Check whether Enabled is true.
- Check the context through IsContextValid method. An exception is thrown if context is invalid.
- Checks the current state - it should be Initial or Stopped.
Commit()
Ends the current operation and applies all changes.
Declaration
protected override void Commit()
Overrides
DisposeManagedResources()
Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.
Declaration
protected override void DisposeManagedResources()
Overrides
DoMouseMove(Point)
Mocks a mouse move to a specific point. Allows for service automation.
EndDrag()
Ends a drag pass. Allows for service automation.
Declaration
public void EndDrag()
EndDrag(Point, RadControl)
Ends a drag pass. Allows for service automation.
Declaration
public void EndDrag(Point mouseEndPoint, RadControl targetControl)
Parameters
mouseEndPoint
The end position of the mouse cursor in screen coordinates.
targetControl
An instance of RadControl.
GetDropTarget(Point, out Point)
Declaration
protected virtual ISupportDrop GetDropTarget(Point mousePosition, out Point resultDropLocation)
Parameters
mousePosition
resultDropLocation
Returns
HandleEscKeyDown()
Declaration
protected virtual void HandleEscKeyDown()
HandleLeftButtonUp()
Declaration
protected virtual void HandleLeftButtonUp()
HandleMouseMove(Point)
Declaration
protected virtual void HandleMouseMove(Point mousePos)
Parameters
mousePos
IsDropTargetValid(ISupportDrop)
Declaration
protected virtual bool IsDropTargetValid(ISupportDrop dropTarget)
Parameters
dropTarget
Returns
OnPreviewDragDrop(RadDropEventArgs)
Declaration
protected virtual void OnPreviewDragDrop(RadDropEventArgs e)
Parameters
e
OnPreviewDragHint(PreviewDragHintEventArgs)
Declaration
protected virtual void OnPreviewDragHint(PreviewDragHintEventArgs e)
Parameters
e
OnPreviewDragOver(RadDragOverEventArgs)
Declaration
protected virtual void OnPreviewDragOver(RadDragOverEventArgs e)
Parameters
e
OnPreviewDragStart(PreviewDragStartEventArgs)
Declaration
protected virtual void OnPreviewDragStart(PreviewDragStartEventArgs e)
Parameters
e
OnPreviewDropTarget(PreviewDropTargetEventArgs)
Declaration
protected virtual void OnPreviewDropTarget(PreviewDropTargetEventArgs e)
Parameters
e
PerformStart()
Performs the core Start logic.
Declaration
protected override void PerformStart()
Overrides
PerformStop()
Stops the service. Performs the core logic.
Declaration
protected override void PerformStop()
Overrides
RestoreOriginalMouseCursor()
Declaration
protected virtual void RestoreOriginalMouseCursor()
SetHintWindowPosition(Point)
Declaration
protected virtual void SetHintWindowPosition(Point mousePt)
Parameters
mousePt
Events
PreviewDragDrop
Declaration
public event EventHandler<RadDropEventArgs> PreviewDragDrop
Event Value
PreviewDragHint
Declaration
public event EventHandler<PreviewDragHintEventArgs> PreviewDragHint
Event Value
PreviewDragOver
Declaration
public event EventHandler<RadDragOverEventArgs> PreviewDragOver
Event Value
PreviewDragStart
Declaration
public event EventHandler<PreviewDragStartEventArgs> PreviewDragStart
Event Value
PreviewDropTarget
Declaration
public event EventHandler<PreviewDropTargetEventArgs> PreviewDropTarget
Event Value