Intersoft ClientUI Documentation
DragDropBehavior Class
Members  See Also  Send Feedback
Intersoft.Client.UI.Controls.Interactivity Namespace : DragDropBehavior Class






Provides attached control with drag drop capability to an element that attached with drop target behavior.

Object Model

DragDropBehavior Class

Syntax

Visual Basic (Declaration) 
<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)
Visual Basic (Usage)Copy Code
Dim instance As DragDropBehavior
C# 
[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> 
Delphi 
public class DragDropBehavior = class(Intersoft.Client.Framework.ISBehavior)
JScript 
DescriptionAttribute("Provides attached control with drag drop capability to an element that attached with drop target behavior.")
public class DragDropBehavior extends Intersoft.Client.Framework.ISBehavior
Managed Extensions for C++ 
[DescriptionAttribute("Provides attached control with drag drop capability to an element that attached with drop target behavior.")]
public __gc class DragDropBehavior : public Intersoft.Client.Framework.ISBehavior<UIElement> 
C++/CLI 
[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> 

Remarks

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.

Inheritance Hierarchy

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

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.