We observe that drag and drop feature differs from that of a tool bar. If a connector(Dynamic HV) is picked from the Connector tool bar and two shapes are connected, it automatically corrects the routing. But if a connector(Dynamic HV) is dropped from the Connector palette and connected, it does not route appropriately..User has to click re-route. I’ve attached the screenshot. How to synchronize the behavior between tool bar and drag drop?
We've handled the issue thourgh EventSink Connected and rerouting the connector. Are there other better ways to handle this?
void
EventSinkService_Connected(NConnectionEventArgs args){
//Reroute the connector after ports are connectedif (nDrawingView1.Selection.Nodes[0].GetType().Equals(typeof(NRoutableConnector))){
NRoutableConnector routableConn = (NRoutableConnector)nDrawingView1.Selection.Nodes[0];
if (routableConn.FromShape != null && routableConn.ToShape != null)
{
routableConn.Reroute();
}
}
}