| C1.WPF Namespace > C1DragDropManager Class : RegisterDragSource Method |
'DeclarationPublic Sub RegisterDragSource( _ ByVal source As System.Windows.UIElement, _ ByVal effect As DragDropEffect, _ ByVal keys As System.Windows.Input.ModifierKeys, _ Optional ByVal handledEventsToo As System.Boolean _ )
'UsageDim instance As C1DragDropManager Dim source As System.Windows.UIElement Dim effect As DragDropEffect Dim keys As System.Windows.Input.ModifierKeys Dim handledEventsToo As System.Boolean instance.RegisterDragSource(source, effect, keys, handledEventsToo)
public void RegisterDragSource( System.Windows.UIElement source, DragDropEffect effect, System.Windows.Input.ModifierKeys keys, System.bool handledEventsToo )
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.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2