[]
Registers a UIElement to act as a drag source.
public void RegisterDragSource(UIElement source, DragDropEffect effect, ModifierKeys keys, bool handledEventsToo = false)
Type | Name | Description |
---|---|---|
UIElement | source | UIElement that will act as a drag source. |
DragDropEffect | effect | DragDropEffect that will be supported by the |
ModifierKeys | keys | System.Windows.Input.ModifierKeys that should be pressed in order for the drag operation to start. |
bool | handledEventsToo |
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.