Intersoft.Client.UI.Controls.Interactivity Namespace > DropTargetBehavior Class : AllowDropItem Property |
<CategoryAttribute("Behavior")> Public Property AllowDropItem As Boolean
Dim instance As DropTargetBehavior Dim value As Boolean instance.AllowDropItem = value value = instance.AllowDropItem
[CategoryAttribute("Behavior")] public bool AllowDropItem {get; set;}
[CategoryAttribute("Behavior")] public: property bool AllowDropItem { bool get(); void set ( bool value); }
To make an UIElement droppable, you can choose one of the following approaches:
AllowDrop property is only available in SL4 and WPF. |
The AllowDropItem property determines whether the attached element is dropable.
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