I have added anchors for linking on one node, and when I link to the anchor the link stays with the node, but if I connect the link to the whole node then the link doesn’t move with the node.
Here is the node template with the link anchors added:
<DataTemplate x:Key="Compressor">
<go:SpotPanel
go:Part.SelectionAdorned="True"
go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"
go:Node.LocationSpot="Center"
go:Part.Resizable="False"
go:Part.ResizeElementName="Container"
go:Part.Reshapable="False"
Height="{Binding ElementName=Container, Path=Height }"
Width="{Binding ElementName=Container, Path=Width}">
<Grid Name="Container"
Height="{Binding Path=Data.Height, Mode=TwoWay}"
Width="{Binding Path=Data.Width, Mode=TwoWay}">
<FrameworkElement.ToolTip>
<TextBlock Text="{Binding Path=Data.Text}" />
</FrameworkElement.ToolTip>
<Viewbox Stretch="Fill">
<Grid Background="White"
go:Node.PortId="" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" Cursor="Hand"
go:Node.FromSpot="AllSides" go:Node.ToSpot="AllSides">
<Path StrokeThickness="1.5" Stroke="#ff000000" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
Data="..."/>
</Grid>
</Viewbox>
<Rectangle Fill="Transparent" Margin="10" />
</Grid>
<Rectangle Fill="Transparent" Width="6" Height="6"
Stroke="{Binding Path=Node.Tag, Converter={StaticResource theStrokeChooser}}"
go:SpotPanel.Spot="MiddleLeft" go:SpotPanel.Alignment="MiddleLeft"
go:Node.PortId="L" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" Cursor="Hand"
go:Node.FromSpot="MiddleLeft" go:Node.ToSpot="MiddleLeft" />
<Rectangle Fill="Transparent" Width="6" Height="6"
Stroke="{Binding Path=Node.Tag, Converter={StaticResource theStrokeChooser}}"
go:SpotPanel.Spot="MiddleTop" go:SpotPanel.Alignment="MiddleTop"
go:Node.PortId="T" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" Cursor="Hand"
go:Node.FromSpot="MiddleTop" go:Node.ToSpot="MiddleTop" />
<Rectangle Fill="Transparent" Width="6" Height="6"
Stroke="{Binding Path=Node.Tag, Converter={StaticResource theStrokeChooser}}"
go:SpotPanel.Spot="MiddleRight" go:SpotPanel.Alignment="MiddleRight"
go:Node.PortId="R" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" Cursor="Hand"
go:Node.FromSpot="MiddleRight" go:Node.ToSpot="MiddleRight" />
<Rectangle Fill="Transparent" Width="6" Height="6"
Stroke="{Binding Path=Node.Tag, Converter={StaticResource theStrokeChooser}}"
go:SpotPanel.Spot="MiddleBottom" go:SpotPanel.Alignment="MiddleBottom"
go:Node.PortId="B" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" Cursor="Hand"
go:Node.FromSpot="MiddleBottom" go:Node.ToSpot="MiddleBottom" />
</go:SpotPanel>
</DataTemplate>
Any idea what might cause the difference? Also, for whatever reason when linking to/from the whole node the pink linking box that pops up is much larger than the actual node… Any thoughts on what might cause that?