You can override the default cursors that are used when you end users perform actions within the drag and drop framework. The following cursor templates are available.
Assumptions:
This topic assumes that you already have drag and drop functionality implemented on your page. For more information, see the Getting Started with Infragistics Drag and Drop Framework topic.
After completing the steps in this walkthrough, you will have customized MoveCursorTemplate and DropNotAllowedCursorTemplate. You can modify cursor templates to achieve better user experience and indicate clearly in what state the dragged element is.
-
Set a DragSource object’s MoveCursorTemplate and DropNotAllowedCursorTemplate. Green and red colored ellipse indicates if the dragged element is over a valid drop target.
In XAML:
<ig:DragDropManager.DragSource> <ig:DragSource IsDraggable="True" DragChannels="ChannelA" Drop="DragSource_Drop" > <ig:DragSource.MoveCursorTemplate> <DataTemplate> <Ellipse Fill="Green" Width="50" Height="50" /> </DataTemplate> </ig:DragSource.MoveCursorTemplate> <ig:DragSource.DropNotAllowedCursorTemplate> <DataTemplate> <Ellipse Fill="Red" Width="50" Height="50" /> </DataTemplate> </ig:DragSource.DropNotAllowedCursorTemplate> </ig:DragSource> </ig:DragDropManager.DragSource>
-
Save and run your application.