I have created a context menu for the right click on the node. When the context menu is displayed and I click on the diagram without selecting the context menu option, the selected node is moved to the clicked location.
Please find the attached GIF, I have made a similar code change in the GoXam sample.
In our application we have provided some functionalities for the nodes (like flip, rotate, customized dialogus, etc…), for using the functionalities we have introduced the context menu items which on selection would trigger the feature.
Currently, I am using the WPF Context menu object, which will be shown when the user right clicks on the Node.
Could you please elaborate on the dragging tool’s customization
Below attached code is the only code change done in the DraggableLink class in the samples.
//Added this line in the constructor
myDiagram.MouseRightButtonDown += MyDiagram_MouseRightButtonDown;
//handler for the same
private void MyDiagram_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
ContextMenu menu = new ContextMenu();
menu.Items.Add(“one”);
menu.Items.Add(“two”);
menu.Items.Add(“three”);
menu.IsOpen = true;
}
I haven’t tried your code yet, but you at least need to mark the event as Handled so that other event handlers (such as those of GoXam) don’t do anything.
And I’m concerned that your implementing context menus that way has other deficiencies that you need to implement. I don’t know what those might be. That’s why I would recommend using the standard facilities instead if rolling your own.