1.2: Disconnected links and DraggableLink sample

Another new feature in version 1.2 is support for partly or completely unconnected links.

There’s a new sample, DraggableLink, that demonstrates this along with the ability to drag links in order to disconnect them from nodes and to connect them to other nodes/ports, or to leave them completely disconnected.

You can also drag a link from a Palette to connect to a node. Just as with normally drawn links (LinkingTool) ports are highlit as you drag the end(s) of the link over valid ports.

You need to set the GraphLinksModel.ValidUnconnectedLinks property in order for the model to support links that are partly or completely unconnected.

You need to set the DraggingTool.DraggableLinks property to allow a single link to be dragged by the user and possibly be connected to valid ports on stationary nodes.

The DraggableLink sample also demonstrates many customized Adornment templates. In the above screenshot you can see that the “Gamma” node is selected. The node DataTemplate specifies three custom adornment templates.

The go:Part.SelectionAdornmentTemplate is a thin dashed blue rectangle around the whole node.

The go:Part.ResizeAdornmentTemplate specifies eight blue tool handles, four at the corners and four at the middles of the sides. There is now a go:Part.ResizeElementName attached property, so that the user can resize a different element from the one that gets the selection handles.

The go:Part.RotateAdornmentTemplate is a blue circle. However, when the go:Part.RotationAngle is zero, the rotation handle is positioned above the node instead of to the right of the node. This required a custom RotatingTool.