Hi ,
I want to change the cursor in DragOver() event. So I set
DraggingTool.Source.Diagram.Cursor = Cursors.No;
but the problem is i get an exception saying source as null. i even try to directly set Diagram.Cursor but cursor is not changing. below is the sample code i tried out
protected override void DragOver(Point pt, bool moving, bool copying)
{
// if dragging from a different Diagram
if (DraggingTool.Source != this)
{
// don’t consider nodes that are selected, being dragged
Node over = this.Diagram.Panel.FindElementAt(pt,
Part.FindAncestor,
p => !this.Diagram.SelectedParts.Contains(p),
SearchLayers.Nodes);
// if it’s not OK to drop here, just change the cursor
var node = over.Data as SymbolData;
if (node.Key != “Rack1”)
{
//DraggingTool.Source.Diagram.Cursor = Cursors.No;
Diagram.Cursor = Cursors.No;
return;
}
//DraggingTool.Source.Diagram.Cursor = Cursors.Arrow;
Diagram.Cursor = Cursors.Arrow;
}
base.DragOver(pt, moving, copying);
}
Regards
Arun