Malain

How can i force the connection points of a portshape (in the middle of its sides)

The classic way with EnsureConnectionPoints and HasConnectionPoints doesn't work.



Re: Visual Studio Extensibility EnsureConnectionPoints on PortShape doesn't work

awbliven - MSFT

I'd like to help on this but I need a little more info. Actually any NodeShape can have Ports on its edges, so the Port is the little square shape and the NodeShape (or PortShape) is the larger parent shape. The usual behaviour of a Port is to expose a connection point on the center of its outside edge, that is the edge entirely outside of the containing NodeShape.

I'm guessing that you don't want to change this behaviour but you want to restrict the position of the ports on the NodeShape to be only in the middle of its sides. We don't expose methods to override to accomplish this sort of restriction; instead you could create a rule that would run when a port is added to a node and change its position as desired.






Re: Visual Studio Extensibility EnsureConnectionPoints on PortShape doesn't work

Edward Bakker

Hi,

To be a little bit more precise. I think you probably want to create a "BoundsRule" for this. Have a look at this post for an example.

Hope this helps.

Edward





Re: Visual Studio Extensibility EnsureConnectionPoints on PortShape doesn't work

Malain

Thanks for your answers,

My problem was on the port not on its parent's nodeshape. You can reproduce this whith the 'example.Components' sample by changing the AssociationLink's routing style value from Rectilinear to Straight. (I saw this later)

Now i change my model and i use another graphic representation without port.

Thanks again.