How to Obtain InConnectors and OutConnectors of Node in WPF Diagram?
In the WPF Diagram, you can obtain the InConnectors and OutConnectors of a Container or Node by accessing their Info property. This property provides detailed information about the connectors that are connected to the Container or Node. We have provided the code example for how to achieve this.
Code Snippet:
private void MainWindow_ItemSelectedEvent(object sender, DiagramEventArgs args)
{
var selecteditem = args.Item;
if (selecteditem != null)
{
if (selecteditem is ContainerViewModel)
{
var container = ((selecteditem as ContainerViewModel) as INode).Info;
var InConnectors = (container as IContainerInfo).InConnectors;
foreach(var inconnector in InConnectors )
{
ConnectorViewModel inComingconnector = (ConnectorViewModel) inconnector;
}
var OutConnectors = (container as IContainerInfo).OutConnectors;
foreach(var outconnector in OutConnectors)
{
ConnectorViewModel outGoingconnector = (ConnectorViewModel) outconnector;
}
}
}
}
Conclusion
I hope you enjoyed learning about how to obtain InConnectors and OutConnectors of node in WPF 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, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!