Intersoft.Client.UI.Controls.Interactivity Namespace > DropTargetBehavior Class : DropBehavior Property |
<CategoryAttribute("Behavior")> Public Property DropBehavior As DropBehavior
Dim instance As DropTargetBehavior Dim value As DropBehavior instance.DropBehavior = value value = instance.DropBehavior
[CategoryAttribute("Behavior")] public DropBehavior DropBehavior {get; set;}
[CategoryAttribute("Behavior")] public: property DropBehavior DropBehavior { DropBehavior get(); void set ( DropBehavior value); }
With DropTargetBehavior, you can easily customize the tooltip when an object is being dragged over to a target element by specifying the TooltipIcon property and the TooltipText property. You can also determine the drop action from DropBehavior property if the drop target is a Panel element.
The following list explains several drop behaviors that you can apply:
To learn how to handle Drop event, see How to: Copy the dragged object when dropped to the drop target and How to: Remove the drag object when dropped to drop target.
All drag-drop related events including the DropEvent are built with routed events architecture. This allows you to handle the events anywhere in the visual tree. To learn more about routed event, see Routed Events Overview. |
The following code demonstrates how to make an UIElement droppable using DropTargetBehavior.
Dropable Grid Element |
Copy Code
|
---|---|
<Grid HorizontalAlignment="Center" Height="100" VerticalAlignment="Center" Width="100" Background="Gray" AllowDrop="True"> <i:Interaction.Behaviors> <Intersoft:DropTargetBehavior AllowDropItem="True" TooltipIcon="accept.png" TooltipText="Drop here."/> </i:Interaction.Behaviors> </Grid> |
Dropable ListBox |
Copy Code
|
---|---|
<ListBox HorizontalAlignment="Center" Height="100" VerticalAlignment="Center" Width="100"> <i:Interaction.Behaviors> <Intersoft:DropTargetBehavior AllowDropItem="True" DropBehavior="Custom" TooltipIcon="accept.png" TooltipText="Drop here."//> </i:Interaction.Behaviors> </ListBox> |
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