This example shows how to change the tooltip when leaving a drop target.
Example
Description
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. |
Code
XAML | ![]() |
---|---|
<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# | ![]() |
---|---|
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."); } |
DragLeaveEvent Field
DragEventArgs Class
DragEventArgs Class
Concepts
Drag-drop Framework Overview
Interactive Panels Overview
Tasks
How-to: Change Tooltip when Hovering Drop Target
Other Resources
Drag-drop Framework How-to Topics
Interactive Panels How-to Topics
Locating the Samples in Local Installation
Walkthroughs and How-to Topics