How to handle the NodePort and Draw button in each node?

Hi there,

I tried to add diagrams, nodes, the connector port in node by C# code behind.

Maybe I miss, but I didn't find the document which explain the Drag&Drop Connector (Red arrow in image).

(The problem image: https://imgur.com/a/r6jAP)

The similar document I found is: https://help.syncfusion.com/wpf/sfdiagram/tools

But after tried, still no luck :(


Another question is I need handle the default floating button in every node.
But I find context menu's document, but not found floating button's document.


Thanks!



1 Reply

JS Jayanthi Sivabalan Syncfusion Team December 26, 2017 09:14 AM UTC

Hi Nathaniel, 
 
Please find the response for the reported issue. 
Sl.No. 
Reported issue 
Response 
1 
 I tried to add diagrams, nodes, the connector port in node by C# code behind. 
 
Maybe I miss, but I didn't find the document which explain the Drag&Drop Connector (Red arrow in image). 
 
(The problem image: https://imgur.com/a/r6jAP) 
 
The similar document I found is: https://help.syncfusion.com/wpf/sfdiagram/tools 
 
But after tried, still no luck :( 
 
By default port cannot be dragged or connected. To make a connection between ports, please override SetTool method. When interacting with port, set ‘Draw’ action as shown in the code example. 
 
Please refer the code example as below. 
 
Code example: 
public class CustomDiagram : SfDiagram 
{ 
   protected override void SetTool(SetToolArgs args) 
   { 
      if (args.Source is IPort) 
      { 
         // draw a connector from port 
         args.Action = ActiveTool.Draw; 
      } 
      else 
      { 
          base.SetTool(args); 
      } 
   } 
} 
 
Please refer the sample link as below. 
 
2 
Another question is I need handle the default floating button in every node. 
But I find context menu's document, but not found floating button's document. 
 
Floating buttons are called as QuickCommands. Please refer the below documentation link for more information about the floating button customization. 
 
 
Please let us know, if you have any further assistance on this. 
 
Regards, 
Jayanthi S. 
 


Loader.
Up arrow icon