This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is there a way to specify the position of a connection point on a given edge in the constructor of the node. At present, the only way i can see to define the position of connection points around the outside of the shape, is by setting the connectionpointpositions property in the nodes style. Weve created some custom connection point types, and in the constructor they accept an edge and a value, ideally, i want the connection point to placed at the specified value of the edge in question. I have spotted position calculators, and also the position property of the diagramconnection point class, but altering either of these does not seem to have an effect on the location of the connection point.
any help would be greatly appreciated.
Cheers. |
|
|
On a related topic, is there a way to simply add a number of nodes to an edge, and for them to be evenly distributed along said edge. How would this work on non-square nodes? |
|
|
Hello Yes it is possible to do these things. I have attached a sample that more or less demonstrates what you have described. To run the sample, make sure to include a reference to your copy of the Mindscape.WpfDiagramming.Foundation.dll. When you run the sample, hover the mouse over the node and you will see the bottom edge has 3 evenly spaced connection points. Their positions have been setup in the custom node constructor. The sample is also used to demonstrate how to dynamically add connection points and have them remain evenly spaced. You may not care about this functionality, so you may want to refactor the AddConnectionPoint and UpdateConnectionPointCalculators in to the constructor or a method. The position of the connection points have been specified by setting their PositionCalculator property to be an OffsetPositionCalculator. This is what the ConnectionPointPositions property you mentioned does behind the scenes. The calculation on line 39 of MultiConnectionPointNode.cs is used to evenly distribute the connection points. Let me know if you have any questions about using the OffsetPositionCalculator. If this approach does not work for you, then there may be an issue with your custom connection point implementations. Let us know how it goes |
|