Link duplicates problem

Hello,

I’m experiencing following Problem. Although two nodes are already linked, and LinkDuplicates is false, the method IsLinked Returns false for the two nodes.
I suspect it has to do with my node Definition in XAML. Maybe someone can tell me if I there’s some Problem with this Definition.

Here’ some debug Output, where the two nodes have a link, but I guess that either the from or two doesn’t exactly match. I previously had already some Errors there with relinking which I was able to solve by Setting go:Node.PortId="" on the element in the XAML Definition (see below).

from: Node:165/System.Windows.Controls.Border/ ; to: Node:166/System.Windows.Controls.Border/
IsLinked: False
LinkableDuplicates fromport: False
LinkableDuplicates toport: False


<DataTemplate x:Key="">
	<go:SpotPanel Style="{StaticResource SpotPanelStyle}" go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}">
		<i:Interaction.Triggers>
			<i:EventTrigger EventName="MouseEnter">
				<command:EventToCommand Command="{Binding Path=DataContext.NodeMouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type local:GoWpfUserControl}}, Mode=OneWay}" CommandParameter="{Binding Data}" />
			</i:EventTrigger>
			<i:EventTrigger EventName="MouseLeave">
				<command:EventToCommand Command="{Binding Path=DataContext.NodeMouseLeaveCommand, RelativeSource={RelativeSource AncestorType={x:Type local:GoWpfUserControl}}, Mode=OneWay}" CommandParameter="{Binding Data}" />
			</i:EventTrigger>
		</i:Interaction.Triggers>
		<Border x:Name="Border"
				Background="{Binding Path=Node.IsSelected,
									 Converter={StaticResource theSelectedBrushConverter}}"
				BorderBrush="DarkBlue"
				BorderThickness="1"
				CornerRadius="3"
				Cursor="Hand"
				Padding="5"
				go:Node.LinkableFrom="True"
				go:Node.LinkableTo="True"
				go:Node.PortId="">
			<StackPanel Name="GoStackPanel"
						Width="150"
						MinWidth="100"
						MinHeight="50"
						Cursor="Arrow"
						go:Node.LinkableFrom="False"
						go:Node.LinkableTo="False">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="Auto" />
					</Grid.ColumnDefinitions>
					<TextBlock Grid.Column="0"
							   Grid.ColumnSpan="2"
							   VerticalAlignment="Center"
							   FontSize="11"
							   FontWeight="Bold"
							   Text="{Binding Data.Label}"
							   TextAlignment="Center" />
					<Image Grid.Column="1"
						   Width="20"
						   Height="20"
						   HorizontalAlignment="Right"
						   RenderOptions.BitmapScalingMode="HighQuality"
						   SnapsToDevicePixels="True"
						   Source="pack://application:,,,/MasterData/Workflow/Designer/Resources/cart.jpg"
						   Visibility="{Binding Path=Data.WsdeIscommissioning,
												Converter={StaticResource BooleanToVisibilityConverter}}" />
				</Grid>
				<TextBlock FontSize="11"
						   FontWeight="Bold"
						   Text="{Binding Data.DescriptionWorkcentertype}"
						   TextAlignment="Center" />
				<Expander IsExpanded="{Binding Data.IsExpanded}" Visibility="{Binding Path=Data.HasStwsAssignments, Converter={StaticResource BooleanToVisibilityConverter}}">
					<ListView Name="ListView" ItemsSource="{Binding Data.WsdeStwsAssignments}">
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="MouseDoubleClick">
								<command:EventToCommand Command="{Binding Path=DataContext.ListViewItemDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type local:GoWpfUserControl}}, Mode=OneWay}" CommandParameter="{Binding ElementName=ListView, Path=SelectedItem}" />
							</i:EventTrigger>
						</i:Interaction.Triggers>
						<ListView.ItemTemplate>
							<DataTemplate>
								<TextBlock FontSize="10" Text="{Binding Label}" />
							</DataTemplate>
						</ListView.ItemTemplate>
					</ListView>
				</Expander>
			</StackPanel>
		</Border>
		<!--
			A Standard node has four ports, the top incoming only, the
			bottom outgoing only, and the other two support both directions.
			Port appearance depends on the Node.Tag property.
			The FromSpot and ToSpot properties control where the link connects.
			The SpotPanel properties control where the port is positioned.
		-->
		<!--  ~1~  top  @1@  -->
		<!--  <Ellipse Stroke="{Binding Path=Data.PortsVisible,  -->
		<!--  Converter={StaticResource theBooleanBrushConverter}}"  -->
		<!--  Style="{StaticResource EllipseStyle}"  -->
		<!--  go:Node.LinkableFrom="False"  -->
		<!--  go:Node.LinkableSelfNode="True"  -->
		<!--  go:Node.PortId="PortTop"  -->
		<!--  go:Node.ToSpot="MiddleTop"  -->
		<!--  go:SpotPanel.Alignment="MiddleTop"  -->
		<!--  go:SpotPanel.Spot="MiddleTop" />  -->
		<!--  ~1~  bottom  @1@  -->
		<!--  <Ellipse Stroke="{Binding Path=Data.PortsVisible,  -->
		<!--  Converter={StaticResource theBooleanBrushConverter}}"  -->
		<!--  Style="{StaticResource EllipseStyle}"  -->
		<!--  go:Node.FromSpot="MiddleBottom"  -->
		<!--  go:Node.LinkableSelfNode="True"  -->
		<!--  go:Node.LinkableTo="False"  -->
		<!--  go:Node.PortId="PortBottom"  -->
		<!--  go:SpotPanel.Alignment="MiddleBottom"  -->
		<!--  go:SpotPanel.Spot="MiddleBottom" />  -->
		<!--  left side  -->
		<Ellipse Stroke="{Binding Path=Data.PortsVisible,
								  Converter={StaticResource theBooleanBrushConverter}}"
				 Style="{StaticResource EllipseStyle}"
				 go:Node.FromEndSegmentLength="50"
				 go:Node.FromSpot="MiddleLeft"
				 go:Node.PortId="PortLeft"
				 go:Node.ToEndSegmentLength="50"
				 go:Node.ToSpot="MiddleLeft"
				 go:SpotPanel.Alignment="MiddleLeft"
				 go:SpotPanel.Spot="MiddleLeft" />
		<!--  right side  -->
		<Ellipse Stroke="{Binding Path=Data.PortsVisible,
								  Converter={StaticResource theBooleanBrushConverter}}"
				 Style="{StaticResource EllipseStyle}"
				 go:Node.FromEndSegmentLength="50"
				 go:Node.FromSpot="MiddleRight"
				 go:Node.PortId="PortRight"
				 go:Node.ToEndSegmentLength="50"
				 go:Node.ToSpot="MiddleRight"
				 go:SpotPanel.Alignment="MiddleRight"
				 go:SpotPanel.Spot="MiddleRight" />
		<Image Width="16"
			   Height="16"
			   Margin="0,0,-16,20"
			   Source="pack://application:,,,/MasterData/Workflow/Designer/Resources/stopwatch.ico"
			   Visibility="{Binding Path=Data.PortsVisible,
									Converter={StaticResource BooleanToVisibilityConverter}}"
			   go:SpotPanel.Spot="MiddleRight" />
		<Image Width="16"
			   Height="16"
			   Margin="-16,0,0,20"
			   Source="pack://application:,,,/MasterData/Workflow/Designer/Resources/stopwatch.ico"
			   Visibility="{Binding Path=Data.PortsVisible,
									Converter={StaticResource BooleanToVisibilityConverter}}"
			   go:SpotPanel.Spot="MiddleLeft" />
	</go:SpotPanel>
</DataTemplate>

was able to fix it myself.

The Problem was that the Initial links were created with Port-Ids set to string.Empty and that when editing the diagram the port-Ids were null. Thus setting the port-Ids to null initially solved it.

Kind regards,
Marc