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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to connect only with port not with node in WPF Diagram (SfDiagram)?

Platform: WPF |
Control: SfDiagram

By default, you can connect nodes or its ports by dragging the endpoints of the connector or by using drawing tools in WPF Diagram (SfDiagram). You can decide over the connection to the node or port by using the Constraints property.

For example, achieving port to port connection alone in the diagram are explained as follows:

  • Disable connection behavior from the node.
  • Stop or disable ports inheriting behavior. Since, port behavior will be inherited from its parent (i.e., Node).

Refer to the following code example and sample link for the previously explained scenario.

C#

node1.Constraints &= ~NodeConstraints.Connectable;
port1.Constraints = PortConstraints.Connectable & ~PortConstraints.InheritConnectable;
 
Here node1 is the instance of the NodeViewModel and port1 is the instance of NodePortViewModel.

View sample in GitHub.

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile