We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to disable center connection port

In my solution, I am setting a node's IsPortEnabled property to false, per your Diagram Builder sample.  A warning is output, stating that IsPortEnabled is obsolete, and that "PortVisibility covers all behaviors."  Two questions arise:

  1. Can I assume this means if I set the center port's PortVisibility is AlwaysHidden, that it will not be possible to connect to the center port
  2. How can I reliably obtain a reference to the center connection port?

1 Reply

MP Mohana Priya Raja Syncfusion Team July 23, 2014 11:58 AM UTC

Hi Jeff,

Please find responses to your queries as below.

1.Can I assume this means if I set the center port's PortVisibility is AlwaysHidden, that it will not be possible to connect to the center port

By default, Connection to Centerport is always makes connection between Node and Connector at Node’s Boundary. So, PortVisibility does not affect this default behavior. Please refer to the below screenshot for default behavior.

Default Behavior :


 

 

2. How can I reliably obtain a reference to the center connection port?

Regarding “obtain a reference to the center connection port”, your requirement has been achieved by using Ports collection property of the Node. We have provided code snippet to represent our solution. Please refer to the below code snippet.

 

Code Snippet:

//getting centerport reference

ConnectionPort centerport = n.Ports[0] as ConnectionPort;

 

Here, n is instance of Node.

 

Please let us know if you have any concerns

Regards,

MohanaPriya R


Loader.
Live Chat Icon For mobile
Up arrow icon