Articles in this section
Category / Section

How to enable the snapping lines only for nodes in the WPF Diagram (SfDiagram)?

1 min read

WPF Diagram (SfDiagram) provides support to enable or disable the snapping for the nodes or connectors. Here, we have provided the code example for disabling the snapping lines for the connectors. Enable snap lines only for nodes by removing the segment constraints from the SnapToObject in SnapSettings. Please refer to the following code example:

Code Snippet

// Here, the SfDiagram is the instance of the SfDiagram class.
SfDiagram.SnapSettings = new SnapSettings()
{
      //To disable the snap lines for the connector.
        SnapToObject = SnapToObject.All & ~SnapToObject.Segment,
};

SnappingOnlyForNode.gif

View sample in GitHub

Conclusion
I hope you enjoyed learning how to enable the snapping lines only for nodes in the WPF Diagram (SfDiagram).

You can refer to our WPF Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

For current customers, check out our components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our other controls.

Please let us know in the following comments section if you have any queries or require clarifications. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

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