Cursor should be change to grab Icon while draging

Cursor should be change to Grab icon while draging the selected nodes in diagram. e.g. Hand tool in Pdf. (using silverlight 4.0) .

we have already tried
protected override void DragOver(Point pt, bool moving, bool copying)
...
..
//don't consider nodes that are selected, being dragged
Node over = this.Diagram.Panel.FindElementAt<Node>(pt, Part.FindAncestor<Node>, p => !this.Diagram.SelectedParts.Contains(p), SearchLayers.Nodes); //if it's not OK to drop here, just change the cursor if (!IsOK(over, null, null)) { DraggingTool.Source.Diagram.Cursor = Cursors.SizeNESW; return; } DraggingTool.Source.Diagram.Cursor = Cursors.Arrow;
..
..
we guess it is internally overridden by some thing else. Please provide some pointers.

Actually, the DraggingTool does not set the Diagram.Cursor at all. But you can make it do so:

public class CustomDraggingTool : Northwoods.GoXam.Tool.DraggingTool { public override void DoActivate() { base.DoActivate(); this.Diagram.Cursor = System.Windows.Input.Cursors.SizeNESW; } public override void DoDeactivate() { base.DoDeactivate(); this.Diagram.Cursor = null; } }
Install by setting myDiagram.DraggingTool = new CustomDraggingTool() in code or in XAML.

Hi Walter,

I have tried with solution as you have
mentioned above but don’t get success.

To narrow down the
issue I try to directly set Diagram.Cursor for whole diagram itself even then
cursor doesn’t changed.


<go:Diagram x:Name=“OrgChartDiagram”
HorizontalContentAlignment=“Stretch” VerticalContentAlignment=“Stretch” NodeTemplateDictionary="{StaticResource
NodeTemplateDictionary}" LinkTemplateDictionary="{StaticResource
LinkTemplateDictionary}" BorderThickness=“0” AllowDrop=“True” Background=“Transparent” Template="{StaticResource DiagramTemplate}" Model="{Binding OrgChartModel, Mode=TwoWay}" Cursor=“Hand”

On Form I also found someone
else facing similar kind of issue.“Diagram cursor problem

Is there any thing
overriding Cursor internally or something else needed to be done.

That other post/topic was about Windows drag-and-drop in WPF.

Setting Diagram.Cursor in XAML is pointless because it is constantly being reset while the mouse moves and tools run.

Ok. I got your point. There might be some other cause. Just for clearification after suggested implementation this.Diagram.Cursor was set to Cursors.SizeNESW, but on UI It was still showing Arrow. I am attaching the screenshot below. Could you suggest the possible cause of issue.

I don’t know – it works for me. I’ve replaced the Diagram.DraggingTool in two different Silverlight 4 samples and got the result that dragging, either for move or for copy, used the specified cursor. And I used different cursors in each case, just to make sure.

Could you tell me exactly how to reproduce the problem? Precisely which version are you using and on which operating system?

We have acheived it, the fault was at our side as we had set Cursor porperty at parent element to “Arrow”(using style in app.xaml). Thanks for providing pointer that it is working fine in your Sample Code… :)