C# Class GongSolutions.Wpf.DragDrop.DragDrop

Show file Open project: punker76/gong-wpf-dragdrop Class Usage Examples

Public Properties

Property Type Description
DataFormat System.Windows.DataFormat
DefaultDragAdornerOpacityProperty System.Windows.DependencyProperty
DragAdornerTemplateProperty System.Windows.DependencyProperty
DragAdornerTemplateSelectorProperty System.Windows.DependencyProperty
DragDirectlySelectedOnlyProperty System.Windows.DependencyProperty
DragDropContextProperty System.Windows.DependencyProperty
DragDropCopyKeyStateProperty System.Windows.DependencyProperty
DragHandlerProperty System.Windows.DependencyProperty
DragMouseAnchorPointProperty System.Windows.DependencyProperty
DragSourceIgnoreProperty System.Windows.DependencyProperty
DropHandlerProperty System.Windows.DependencyProperty
EffectAllAdornerTemplateProperty System.Windows.DependencyProperty
EffectCopyAdornerTemplateProperty System.Windows.DependencyProperty
EffectLinkAdornerTemplateProperty System.Windows.DependencyProperty
EffectMoveAdornerTemplateProperty System.Windows.DependencyProperty
EffectNoneAdornerTemplateProperty System.Windows.DependencyProperty
EffectScrollAdornerTemplateProperty System.Windows.DependencyProperty
IsDragSourceProperty System.Windows.DependencyProperty
IsDropTargetProperty System.Windows.DependencyProperty
ItemsPanelOrientationProperty System.Windows.DependencyProperty
UseDefaultDragAdornerProperty System.Windows.DependencyProperty
UseDefaultEffectDataTemplateProperty System.Windows.DependencyProperty
UseVisualSourceItemSizeForDragAdornerProperty System.Windows.DependencyProperty

Private Properties

Property Type Description
CaptureScreen BitmapSource
CreateDefaultEffectDataTemplate System.Windows.DataTemplate
CreateDragAdorner void
CreateEffectAdorner void
DragSource_PreviewMouseLeftButtonDown void
DragSource_PreviewMouseLeftButtonUp void
DragSource_PreviewMouseMove void
DragSource_QueryContinueDrag void
DropTarget_GiveFeedback void
DropTarget_PreviewDragEnter void
DropTarget_PreviewDragLeave void
DropTarget_PreviewDragOver void
DropTarget_PreviewDrop void
GetEffectAdornerTemplate System.Windows.DataTemplate
IsDragSourceChanged void
IsDropTargetChanged void
Scroll void
TryGetDragHandler IDragSource
TryGetDropHandler IDropTarget

Public Methods

Method Description
GetDefaultDragAdornerOpacity ( UIElement target ) : double
GetDragAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
GetDragAdornerTemplateSelector ( DependencyObject element ) : System.Windows.Controls.DataTemplateSelector
GetDragDirectlySelectedOnly ( DependencyObject obj ) : bool
GetDragDropContext ( UIElement target ) : string
GetDragDropCopyKeyState ( UIElement target ) : DragDropKeyStates

Gets the drag drop copy key state indicating the effect of the drag drop operation.

GetDragHandler ( UIElement target ) : IDragSource
GetDragMouseAnchorPoint ( UIElement target ) : Point
GetDragSourceIgnore ( UIElement source ) : bool
GetDropHandler ( UIElement target ) : IDropTarget
GetEffectAllAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
GetEffectCopyAdornerTemplate ( UIElement target, string destinationText ) : System.Windows.DataTemplate
GetEffectLinkAdornerTemplate ( UIElement target, string destinationText ) : System.Windows.DataTemplate
GetEffectMoveAdornerTemplate ( UIElement target, string destinationText ) : System.Windows.DataTemplate
GetEffectNoneAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
GetEffectScrollAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
GetIsDragSource ( UIElement target ) : bool
GetIsDropTarget ( UIElement target ) : bool
GetItemsPanelOrientation ( UIElement source ) : Orientation?

Gets the Orientation which should be used for the drag drop action (default null). Normally it will be look up to find the correct orientaion of the inner ItemsPanel, but sometimes it's necessary to force the oreintation, if the look up is wrong.

GetUseDefaultDragAdorner ( UIElement target ) : bool
GetUseDefaultEffectDataTemplate ( UIElement target ) : bool
GetUseVisualSourceItemSizeForDragAdorner ( UIElement target ) : bool
SetDefaultDragAdornerOpacity ( UIElement target, double value ) : void
SetDragAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
SetDragAdornerTemplateSelector ( DependencyObject element, System.Windows.Controls.DataTemplateSelector value ) : void
SetDragDirectlySelectedOnly ( DependencyObject obj, bool value ) : void
SetDragDropContext ( UIElement target, string value ) : void
SetDragDropCopyKeyState ( UIElement target, DragDropKeyStates value ) : void

Sets the drag drop copy key state indicating the effect of the drag drop operation.

SetDragHandler ( UIElement target, IDragSource value ) : void
SetDragMouseAnchorPoint ( UIElement target, Point value ) : void
SetDragSourceIgnore ( UIElement source, bool value ) : void
SetDropHandler ( UIElement target, IDropTarget value ) : void
SetEffectAllAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
SetEffectCopyAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
SetEffectLinkAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
SetEffectMoveAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
SetEffectNoneAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
SetEffectScrollAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
SetIsDragSource ( UIElement target, bool value ) : void
SetIsDropTarget ( UIElement target, bool value ) : void
SetItemsPanelOrientation ( UIElement source, Orientation value ) : void

Sets the Orientation which should be used for the drag drop action (default null). Normally it will be look up to find the correct orientaion of the inner ItemsPanel, but sometimes it's necessary to force the oreintation, if the look up is wrong.

SetUseDefaultDragAdorner ( UIElement target, bool value ) : void
SetUseDefaultEffectDataTemplate ( UIElement target, bool value ) : void
SetUseVisualSourceItemSizeForDragAdorner ( UIElement target, bool value ) : void

Private Methods

Method Description
CaptureScreen ( Visual target, FlowDirection flowDirection ) : BitmapSource
CreateDefaultEffectDataTemplate ( UIElement target, BitmapImage effectIcon, string effectText, string destinationText ) : System.Windows.DataTemplate
CreateDragAdorner ( GongSolutions.Wpf.DragDrop.DropInfo dropInfo ) : void
CreateEffectAdorner ( GongSolutions.Wpf.DragDrop.DropInfo dropInfo ) : void
DragSource_PreviewMouseLeftButtonDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
DragSource_PreviewMouseLeftButtonUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
DragSource_PreviewMouseMove ( object sender, System.Windows.Input.MouseEventArgs e ) : void
DragSource_QueryContinueDrag ( object sender, System.Windows.QueryContinueDragEventArgs e ) : void
DropTarget_GiveFeedback ( object sender, System.Windows.GiveFeedbackEventArgs e ) : void
DropTarget_PreviewDragEnter ( object sender, System.Windows.DragEventArgs e ) : void
DropTarget_PreviewDragLeave ( object sender, System.Windows.DragEventArgs e ) : void
DropTarget_PreviewDragOver ( object sender, System.Windows.DragEventArgs e ) : void
DropTarget_PreviewDrop ( object sender, System.Windows.DragEventArgs e ) : void
GetEffectAdornerTemplate ( UIElement target, DragDropEffects effect, string destinationText ) : System.Windows.DataTemplate
IsDragSourceChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
IsDropTargetChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
Scroll ( ScrollViewer scrollViewer, System.Windows.DragEventArgs e ) : void
TryGetDragHandler ( GongSolutions.Wpf.DragDrop.DragInfo dragInfo, UIElement sender ) : IDragSource

Gets the drag handler from the drag info or from the sender, if the drag info is null

TryGetDropHandler ( GongSolutions.Wpf.DragDrop.DropInfo dropInfo, UIElement sender ) : IDropTarget

Gets the drop handler from the drop info or from the sender, if the drop info is null

Method Details

GetDefaultDragAdornerOpacity() public static method

public static GetDefaultDragAdornerOpacity ( UIElement target ) : double
target UIElement
return double

GetDragAdornerTemplate() public static method

public static GetDragAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
target UIElement
return System.Windows.DataTemplate

GetDragAdornerTemplateSelector() public static method

public static GetDragAdornerTemplateSelector ( DependencyObject element ) : System.Windows.Controls.DataTemplateSelector
element System.Windows.DependencyObject
return System.Windows.Controls.DataTemplateSelector

GetDragDirectlySelectedOnly() public static method

public static GetDragDirectlySelectedOnly ( DependencyObject obj ) : bool
obj System.Windows.DependencyObject
return bool

GetDragDropContext() public static method

public static GetDragDropContext ( UIElement target ) : string
target UIElement
return string

GetDragDropCopyKeyState() public static method

Gets the drag drop copy key state indicating the effect of the drag drop operation.
public static GetDragDropCopyKeyState ( UIElement target ) : DragDropKeyStates
target UIElement
return DragDropKeyStates

GetDragHandler() public static method

public static GetDragHandler ( UIElement target ) : IDragSource
target UIElement
return IDragSource

GetDragMouseAnchorPoint() public static method

public static GetDragMouseAnchorPoint ( UIElement target ) : Point
target UIElement
return Point

GetDragSourceIgnore() public static method

public static GetDragSourceIgnore ( UIElement source ) : bool
source UIElement
return bool

GetDropHandler() public static method

public static GetDropHandler ( UIElement target ) : IDropTarget
target UIElement
return IDropTarget

GetEffectAllAdornerTemplate() public static method

public static GetEffectAllAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
target UIElement
return System.Windows.DataTemplate

GetEffectCopyAdornerTemplate() public static method

public static GetEffectCopyAdornerTemplate ( UIElement target, string destinationText ) : System.Windows.DataTemplate
target UIElement
destinationText string
return System.Windows.DataTemplate

GetEffectLinkAdornerTemplate() public static method

public static GetEffectLinkAdornerTemplate ( UIElement target, string destinationText ) : System.Windows.DataTemplate
target UIElement
destinationText string
return System.Windows.DataTemplate

GetEffectMoveAdornerTemplate() public static method

public static GetEffectMoveAdornerTemplate ( UIElement target, string destinationText ) : System.Windows.DataTemplate
target UIElement
destinationText string
return System.Windows.DataTemplate

GetEffectNoneAdornerTemplate() public static method

public static GetEffectNoneAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
target UIElement
return System.Windows.DataTemplate

GetEffectScrollAdornerTemplate() public static method

public static GetEffectScrollAdornerTemplate ( UIElement target ) : System.Windows.DataTemplate
target UIElement
return System.Windows.DataTemplate

GetIsDragSource() public static method

public static GetIsDragSource ( UIElement target ) : bool
target UIElement
return bool

GetIsDropTarget() public static method

public static GetIsDropTarget ( UIElement target ) : bool
target UIElement
return bool

GetItemsPanelOrientation() public static method

Gets the Orientation which should be used for the drag drop action (default null). Normally it will be look up to find the correct orientaion of the inner ItemsPanel, but sometimes it's necessary to force the oreintation, if the look up is wrong.
public static GetItemsPanelOrientation ( UIElement source ) : Orientation?
source UIElement
return Orientation?

GetUseDefaultDragAdorner() public static method

public static GetUseDefaultDragAdorner ( UIElement target ) : bool
target UIElement
return bool

GetUseDefaultEffectDataTemplate() public static method

public static GetUseDefaultEffectDataTemplate ( UIElement target ) : bool
target UIElement
return bool

GetUseVisualSourceItemSizeForDragAdorner() public static method

public static GetUseVisualSourceItemSizeForDragAdorner ( UIElement target ) : bool
target UIElement
return bool

SetDefaultDragAdornerOpacity() public static method

public static SetDefaultDragAdornerOpacity ( UIElement target, double value ) : void
target UIElement
value double
return void

SetDragAdornerTemplate() public static method

public static SetDragAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
target UIElement
value System.Windows.DataTemplate
return void

SetDragAdornerTemplateSelector() public static method

public static SetDragAdornerTemplateSelector ( DependencyObject element, System.Windows.Controls.DataTemplateSelector value ) : void
element System.Windows.DependencyObject
value System.Windows.Controls.DataTemplateSelector
return void

SetDragDirectlySelectedOnly() public static method

public static SetDragDirectlySelectedOnly ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject
value bool
return void

SetDragDropContext() public static method

public static SetDragDropContext ( UIElement target, string value ) : void
target UIElement
value string
return void

SetDragDropCopyKeyState() public static method

Sets the drag drop copy key state indicating the effect of the drag drop operation.
public static SetDragDropCopyKeyState ( UIElement target, DragDropKeyStates value ) : void
target UIElement
value DragDropKeyStates
return void

SetDragHandler() public static method

public static SetDragHandler ( UIElement target, IDragSource value ) : void
target UIElement
value IDragSource
return void

SetDragMouseAnchorPoint() public static method

public static SetDragMouseAnchorPoint ( UIElement target, Point value ) : void
target UIElement
value Point
return void

SetDragSourceIgnore() public static method

public static SetDragSourceIgnore ( UIElement source, bool value ) : void
source UIElement
value bool
return void

SetDropHandler() public static method

public static SetDropHandler ( UIElement target, IDropTarget value ) : void
target UIElement
value IDropTarget
return void

SetEffectAllAdornerTemplate() public static method

public static SetEffectAllAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
target UIElement
value System.Windows.DataTemplate
return void

SetEffectCopyAdornerTemplate() public static method

public static SetEffectCopyAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
target UIElement
value System.Windows.DataTemplate
return void

SetEffectLinkAdornerTemplate() public static method

public static SetEffectLinkAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
target UIElement
value System.Windows.DataTemplate
return void

SetEffectMoveAdornerTemplate() public static method

public static SetEffectMoveAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
target UIElement
value System.Windows.DataTemplate
return void

SetEffectNoneAdornerTemplate() public static method

public static SetEffectNoneAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
target UIElement
value System.Windows.DataTemplate
return void

SetEffectScrollAdornerTemplate() public static method

public static SetEffectScrollAdornerTemplate ( UIElement target, System.Windows.DataTemplate value ) : void
target UIElement
value System.Windows.DataTemplate
return void

SetIsDragSource() public static method

public static SetIsDragSource ( UIElement target, bool value ) : void
target UIElement
value bool
return void

SetIsDropTarget() public static method

public static SetIsDropTarget ( UIElement target, bool value ) : void
target UIElement
value bool
return void

SetItemsPanelOrientation() public static method

Sets the Orientation which should be used for the drag drop action (default null). Normally it will be look up to find the correct orientaion of the inner ItemsPanel, but sometimes it's necessary to force the oreintation, if the look up is wrong.
public static SetItemsPanelOrientation ( UIElement source, Orientation value ) : void
source UIElement
value Orientation
return void

SetUseDefaultDragAdorner() public static method

public static SetUseDefaultDragAdorner ( UIElement target, bool value ) : void
target UIElement
value bool
return void

SetUseDefaultEffectDataTemplate() public static method

public static SetUseDefaultEffectDataTemplate ( UIElement target, bool value ) : void
target UIElement
value bool
return void

SetUseVisualSourceItemSizeForDragAdorner() public static method

public static SetUseVisualSourceItemSizeForDragAdorner ( UIElement target, bool value ) : void
target UIElement
value bool
return void

Property Details

DataFormat public static property

public static DataFormat,System.Windows DataFormat
return System.Windows.DataFormat

DefaultDragAdornerOpacityProperty public static property

public static DependencyProperty,System.Windows DefaultDragAdornerOpacityProperty
return System.Windows.DependencyProperty

DragAdornerTemplateProperty public static property

public static DependencyProperty,System.Windows DragAdornerTemplateProperty
return System.Windows.DependencyProperty

DragAdornerTemplateSelectorProperty public static property

public static DependencyProperty,System.Windows DragAdornerTemplateSelectorProperty
return System.Windows.DependencyProperty

DragDirectlySelectedOnlyProperty public static property

public static DependencyProperty,System.Windows DragDirectlySelectedOnlyProperty
return System.Windows.DependencyProperty

DragDropContextProperty public static property

public static DependencyProperty,System.Windows DragDropContextProperty
return System.Windows.DependencyProperty

DragDropCopyKeyStateProperty public static property

The drag drop copy key state property (default None). So the drag drop action is - Move, within the same control or from one to another, if the drag drop key state is None - Copy, from one to another control with the given drag drop copy key state
public static DependencyProperty,System.Windows DragDropCopyKeyStateProperty
return System.Windows.DependencyProperty

DragHandlerProperty public static property

public static DependencyProperty,System.Windows DragHandlerProperty
return System.Windows.DependencyProperty

DragMouseAnchorPointProperty public static property

DragMouseAnchorPoint defines the horizontal and vertical proportion at which the pointer will anchor on the DragAdorner.
public static DependencyProperty,System.Windows DragMouseAnchorPointProperty
return System.Windows.DependencyProperty

DragSourceIgnoreProperty public static property

public static DependencyProperty,System.Windows DragSourceIgnoreProperty
return System.Windows.DependencyProperty

DropHandlerProperty public static property

public static DependencyProperty,System.Windows DropHandlerProperty
return System.Windows.DependencyProperty

EffectAllAdornerTemplateProperty public static property

public static DependencyProperty,System.Windows EffectAllAdornerTemplateProperty
return System.Windows.DependencyProperty

EffectCopyAdornerTemplateProperty public static property

public static DependencyProperty,System.Windows EffectCopyAdornerTemplateProperty
return System.Windows.DependencyProperty

EffectLinkAdornerTemplateProperty public static property

public static DependencyProperty,System.Windows EffectLinkAdornerTemplateProperty
return System.Windows.DependencyProperty

EffectMoveAdornerTemplateProperty public static property

public static DependencyProperty,System.Windows EffectMoveAdornerTemplateProperty
return System.Windows.DependencyProperty

EffectNoneAdornerTemplateProperty public static property

public static DependencyProperty,System.Windows EffectNoneAdornerTemplateProperty
return System.Windows.DependencyProperty

EffectScrollAdornerTemplateProperty public static property

public static DependencyProperty,System.Windows EffectScrollAdornerTemplateProperty
return System.Windows.DependencyProperty

IsDragSourceProperty public static property

public static DependencyProperty,System.Windows IsDragSourceProperty
return System.Windows.DependencyProperty

IsDropTargetProperty public static property

public static DependencyProperty,System.Windows IsDropTargetProperty
return System.Windows.DependencyProperty

ItemsPanelOrientationProperty public static property

public static DependencyProperty,System.Windows ItemsPanelOrientationProperty
return System.Windows.DependencyProperty

UseDefaultDragAdornerProperty public static property

public static DependencyProperty,System.Windows UseDefaultDragAdornerProperty
return System.Windows.DependencyProperty

UseDefaultEffectDataTemplateProperty public static property

public static DependencyProperty,System.Windows UseDefaultEffectDataTemplateProperty
return System.Windows.DependencyProperty

UseVisualSourceItemSizeForDragAdornerProperty public static property

public static DependencyProperty,System.Windows UseVisualSourceItemSizeForDragAdornerProperty
return System.Windows.DependencyProperty