ComponentOne FinancialChart for WPF
RegisterDragSource Method



C1.WPF Namespace > C1DragDropManager Class : RegisterDragSource Method
System.Windows.UIElement that will act as a drag source.
DragDropEffect that will be supported by the source object.
System.Windows.Input.ModifierKeys that should be pressed in order for the drag operation to start.
Registers a System.Windows.UIElement to act as a drag source.
Syntax
'Declaration
 
Public Sub RegisterDragSource( _
   ByVal source As UIElement, _
   ByVal effect As DragDropEffect, _
   ByVal keys As ModifierKeys, _
   Optional ByVal handledEventsToo As Boolean _
) 
'Usage
 
Dim instance As C1DragDropManager
Dim source As UIElement
Dim effect As DragDropEffect
Dim keys As ModifierKeys
Dim handledEventsToo As Boolean
 
instance.RegisterDragSource(source, effect, keys, handledEventsToo)

Parameters

source
System.Windows.UIElement that will act as a drag source.
effect
DragDropEffect that will be supported by the source object.
keys
System.Windows.Input.ModifierKeys that should be pressed in order for the drag operation to start.
handledEventsToo
Remarks

When a System.Windows.UIElement is registered as a drag source, the C1DragDropManager monitors the mouse events for that element and starts drag-drop operations automatically when the user presses the mouse over the element and moves it for a few pixels.

This is a convenience method, it is not strictly required; you could handle the mouse events for the objects you want to use as drag sources and call the DoDragDrop method explicitly.

To un-register an element as a drag source, call the RegisterDragSource method passing the element and DragDropEffect.None.

Note that only elements that raise mouse events may be used as automatic drag sources. For example, the System.Windows.Controls.Button and System.Windows.Controls.TextBox controls consume mouse events internally, so the C1DragDropManager does not receive any mouse events for these controls. Therefore, they cannot be used as automatic drag sources.

See Also

Reference

C1DragDropManager Class
C1DragDropManager Members