Basic Library for WPF and Silverlight | ComponentOne
C1.Silverlight Namespace / C1DragDropManager Class / RegisterDragSource Method

In This Topic
    RegisterDragSource Method (C1DragDropManager)
    In This Topic
    Syntax
    'Declaration
     
    
    Public Sub RegisterDragSource( _
       ByVal source As UIElement, _
       ByVal effect As DragDropEffect, _
       ByVal keys As ModifierKeys _
    ) 
    public void RegisterDragSource( 
       UIElement source,
       DragDropEffect effect,
       ModifierKeys keys
    )

    Parameters

    source
    effect
    keys
    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