Custom Connector by Default

Hello, 

I created my own connector, derived from ConnectorViewModel.
The only way the user should create connectors is by drag from one port to another.
How can I tell the diagram control to always use my custom connector for drawing connectors?

Best regards,

Alex


1 Reply

AK Arun Kumar Sivakumar Syncfusion Team June 18, 2025 07:09 AM UTC

Hi Alexander,

 

Requirement: How to create a custom connector when drawing connectors from ports.

 

You can achieve this by initializing the Connectors collection with your custom connector type. We have provided a code snippet for your reference.

 


// Here diagram in the instance of the Sfdiagram and CustomConnector in the CustomConnector class.

 

diagram.Connectors = new ObservableCollection<CustomConnector>();

 

Regards,

Arun Kumar S


Loader.
Up arrow icon