Articles in this section
Category / Section

How to control the visibility of ports in WPF Diagram (SfDiagram)?

1 min read

WPF Diagram (SfDiagram) provided support to customize the PortVisibility of NodePort and ConnectorPort. By Default, PortVisibility of Port is based on Inheritance from SfDiagram and Diagramming Object (Node/Connector). PortVisibility customization based on Port can be achieved by removing InheritPortVisibility from constraints of Port. We have provided Code Example. Please refer to this as below.


NodePort nodeport = new NodePort();
//Specifies the PortVisibility
nodeport.Constraints = PortConstraints.Default & ~PortConstraints.InheritPortVisibility;
ConnectorPort connectorport = new ConnectorPort();
//Specifies the PortVisibility
connectorport.Constraints = PortConstraints.Default & ~PortConstraints.InheritPortVisibility;


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied