Intersoft.Client.UI.Controls.Interactivity Namespace : DragDropBehavior Class |
<DescriptionAttribute("Provides attached control with drag drop capability to an element that attached with drop target behavior.")> Public Class DragDropBehavior Inherits Intersoft.Client.Framework.ISBehavior(Of UIElement)
Dim instance As DragDropBehavior
[DescriptionAttribute("Provides attached control with drag drop capability to an element that attached with drop target behavior.")] public class DragDropBehavior : Intersoft.Client.Framework.ISBehavior<UIElement>
[DescriptionAttribute("Provides attached control with drag drop capability to an element that attached with drop target behavior.")] public ref class DragDropBehavior : public Intersoft.Client.Framework.ISBehavior<UIElement>
DragDropBehavior is part of ClientUI drag-drop framework library, to learn more about ClientUI Drag-drop Library see Drag-drop Framework Overview.
To make an UIElement dragable, simply attach a DragDropBehavior to that particular elements as shown in the XAML code below.
XAML |
Copy Code
|
---|---|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <i:Interaction.Behaviors> <Intersoft:DragDropBehavior/> </i:Interaction.Behaviors> <Image Source="folder.png" Height="64" Width="64"/> <TextBlock Text="My Archive" HorizontalAlignment="Center" VerticalAlignment="Center"/> </StackPanel> |
In the above sample, the DragDropBehavior is attached to a StackPanel that has an image and a text element.
When you dragged the StackPanel, the StackPanel is not moved from its original place. The actual element being moved is a shadow object that represents the current dragable object. This shadow object serves as an indicator where the object is currently dragged into. If it is dropped to a non droppable target, there will be an animation to indicate the shadow object being returned to the original position. To learn more how to customize the shadow object, see How to: Customize Drag Shadow Object.
System.Object
System.Windows.DependencyObject
System.Windows.Interactivity.Behavior
System.Windows.Interactivity.Behavior<T>
Intersoft.Client.Framework.ISBehavior<T>
Intersoft.Client.UI.Controls.Interactivity.DragDropBehavior
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