Registers a UIElement to act as a drag source.

Namespace:  C1.Silverlight
Assembly:  C1.Silverlight (in C1.Silverlight.dll)

Syntax

C#
public void RegisterDragSource(
	UIElement source,
	DragDropEffect effect,
	ModifierKeys keys
)
Visual Basic
Public Sub RegisterDragSource ( _
	source As UIElement, _
	effect As DragDropEffect, _
	keys As ModifierKeys _
)

Parameters

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

Remarks

When a 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(UIElement, MouseEventArgs, DragDropEffect) 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 Button and 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