Intersoft ClientUI Documentation
DragLeave Event (DropTargetBehavior)



Occurs when drag is leaving drop target.
Syntax
Public Event DragLeave As DragEventHandler
Dim instance As DropTargetBehavior
Dim handler As DragEventHandler
 
AddHandler instance.DragLeave, handler
public event DragEventHandler DragLeave
public:
event DragEventHandler^ DragLeave
Event Data

The event handler receives an argument of type DragEventArgs containing data related to this event. The following DragEventArgs properties provide information specific to this event.

PropertyDescription
AllowedEffects Gets allowed effects.
Data Gets data carried.
Effects Gets current drag effects.
Handled (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
HandledBy (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs)Gets or sets the source object that handles this event.
IsHandledByPrimitive (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs)Determines whether this event is handled internally by control infrastructure.
KeyStates Gets current key states.
OriginalSource (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs)Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.
RoutedEvent (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs)Gets or sets the RoutedEvent associated with this RoutedEventArgs instance.
Source (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) Gets or sets a reference to the object that raised the event.
Remarks

This event raised when an object is leaving the drop target.

Example

The following code shows how to change the tooltip at DragLeave event. 

All drag-drop events are built on routed event architecture including the DragLeaveEvent. To learn more about routed event, see Routed Events overview.
XAML
Copy Code
<Intersoft:UXStackPanel HorizontalAlignment="Center" VerticalAlignment="Top" DragMode="Move" AllowMoveItem="True" AllowDropItem="True">
    <StackPanel>
        <Image Source="folder.png" Height="64" Width="64"/>
        <TextBlock Text="My Archive" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    </StackPanel>
    <StackPanel>
        <Image Source="folder.png" Height="64" Width="64"/>
        <TextBlock Text="My Photos" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    </StackPanel>
    <StackPanel>
        <Image Source="folder.png" Height="64" Width="64"/>
        <TextBlock Text="My Videos" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    </StackPanel>
C#
Copy Code
public MainPage()
{
    // Required to initialize variables
    InitializeComponent();

    ISEventManager.RegisterInstanceHandler(
        this.LayoutRoot, // any element in the routed path which applicable in your scenario
        DragDrop.DragLeaveEvent, // the routed event
        new Intersoft.Client.UI.Controls.Interactivity.DragEventHandler(DropTarget_DragLeave), // the event handler
        true);
}

private void DropTarget_DragLeave(object sender, Intersoft.Client.UI.Controls.Interactivity.DragEventArgs e)
{
    e.SetCustomTooltip("Can not drop to this area.");            
}
Requirements

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

See Also

Reference

DropTargetBehavior Class
DropTargetBehavior Members

Concepts

Drag-drop Framework Overview

Send Feedback