I have a scenario where I am creating a connection between 2 nodes, but the connection line needs to be segmented. To accomplish this, I created a port on a connection line between the 2 nodes with the following code
Dim headnode As New Node()
headnode.Shape = Shapes.RoundedRectangle
headnode.Label = "Head Node"
headnode.Height = 100
headnode.Width = 100
headnode.OffsetX = 200
headnode.OffsetY = 200
diagramModel.Nodes.Add(headnode)
Dim tailnode As New Node()
tailnode.Shape = Shapes.RoundedRectangle
tailnode.Label = "Tail Node"
tailnode.Height = 100
tailnode.Width = 100
tailnode.OffsetX = 400
tailnode.OffsetY = 50
diagramModel.Nodes.Add(tailnode)
Dim line As New LineConnector()
Dim port As New ConnectionPort()
port.PortStyle.Stroke = New SolidColorBrush(Colors.OrangeRed)
port.PortStyle.Fill = New SolidColorBrush(Colors.OrangeRed)
port.Width = 10
port.Height = 10
port.PortOffset = 0.0
port.PortVisibility = PortVisibility.AlwaysVisible
line.Ports.Add(port)
line.ConnectorType = ConnectorType.Straight
line.TailNode = tailnode
port.Edge = line
diagramModel.Connections.Add(line)
Dim line1 As New LineConnector()
line1.LineStyle.Stroke = New SolidColorBrush(Colors.Brown)
line1.TailDecoratorStyle.Stroke = New SolidColorBrush(Colors.Brown)
line1.TailDecoratorStyle.Fill = New SolidColorBrush(Colors.Brown)
line1.TailDecoratorShape =
Syncfusion.Windows.Diagram.DecoratorShape.None
line1.ConnectionTailPort = port
line1.ConnectorType = ConnectorType.Straight
line1.HeadNode = headnode
diagramModel.Connections.Add(line1)
When I select the LineConnector attached to the Tail Node, and reposition the line, the port moves also which is what I want. However, if I select the LineConnector, attached to the Head Node, and reposition the line, the line detaches from the port. Is there a way to either allow the port to be relocated if either the Head or Tail LineConnector is repositioned? Or is there a way to allow the port to be dragged to a new location on the View?