I am working on implementing dynamic ports for our nodes, and am having some issues with the display of the nodes. The static ports display over the edge of the node, but for whatever reason the dynamic ports in the ItemsControl don’t display past the edge. Any suggestion for how to get them to display show up?
<span style="font-size: 12px; line-height: 1.4;"> </span><span style="font-size: 12px; line-height: 1.4;"> </span><go:SpotPanel
go:Part.SelectionAdorned="False"
go:Node.Location="{Binding Path=Data.Location, Mode=OneWay}"
go:Part.Resizable="False"
go:Part.ResizeElementName="Container"
go:Part.ResizeAdornmentTemplate="{DynamicResource NodeResizeAdornmentTemplate}"
go:Part.Rotatable="{Binding Path=Data.Rotatable, Mode=OneWay}"
go:Node.RotationAngle="{Binding Path=Data.Angle, Mode=TwoWay}"
go:Part.RotateAdornmentTemplate="{DynamicResource NodeRotationAdornmentTemplate}"
go:Part.Reshapable="False">
<ContextMenuService.ContextMenu>
<ContextMenu ItemsSource="{DynamicResource NodeContextMenuTemplate}" />
</ContextMenuService.ContextMenu>
<Grid Name="Container"
Height="{Binding Path=Node.Diagram.NodeHeight, Mode=OneWay}"
Width="{Binding Path=Node.Diagram.NodeWidth, Mode=OneWay}"
RenderTransformOrigin ="0.5 0.5">
<Grid.RenderTransform>
<ScaleTransform ScaleX="{Binding Path=Data.ScaleX, Mode=OneWay}" />
</Grid.RenderTransform>
<Grid>
<FrameworkElement.ToolTip>
<TextBlock Text="{Binding Path=Data.Category}" />
</FrameworkElement.ToolTip>
<Viewbox Stretch="Fill">
<Grid UseLayoutRounding="True">
...
</Grid>
</Viewbox>
<Grid UseLayoutRounding="True">
<Grid.RowDefinitions>
<RowDefinition Height="7.5*"/>
<RowDefinition Height="45*"/>
<RowDefinition Height="47.5*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="72*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="18*"/>
</Grid.ColumnDefinitions>
<Viewbox Stretch="Uniform" Grid.Column="1" Grid.Row="1" RenderTransformOrigin="0.5 0.5">
<Viewbox.RenderTransform>
<ScaleTransform ScaleX="{Binding Path=Data.ScaleX, Mode=OneWay}" />
</Viewbox.RenderTransform>
<Path HorizontalAlignment="Center" VerticalAlignment="Center"
Fill="Black"
Data="{Binding Path=Data.TagPoints, Mode=OneWay}"/>
</Viewbox>
</Grid>
</Grid>
</Grid>
<Rectangle Width="7" Height="7" Fill="Red" go:SpotPanel.Alignment="Center"
StrokeThickness="1" Stroke="Red" go:SpotPanel.Spot="0 0.2857 0 0" />
<Rectangle Width="7" Height="7" Fill="Red" go:SpotPanel.Alignment="Center"
StrokeThickness="1" Stroke="Red" go:SpotPanel.Spot="0 0.7143 0 0" />
<Rectangle Width="7" Height="7" Fill="Red" go:SpotPanel.Alignment="Center"
StrokeThickness="1" Stroke="Red" go:SpotPanel.Spot="0.25 0.08 0 0" />
<Rectangle Width="7" Height="7" Fill="Red" go:SpotPanel.Alignment="Center"
StrokeThickness="1" Stroke="Red" go:SpotPanel.Spot="0.95 0.2857 0 0" />
<Rectangle Width="7" Height="7" Fill="Red" go:SpotPanel.Alignment="Center"
StrokeThickness="1" Stroke="Red" go:SpotPanel.Spot="0.25 1 0 0" />
<ItemsControl ItemsSource="{Binding Path=Data.DynamicAnchors}">
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="go:SpotPanel.Spot" Value="{Binding Path=AnchorSpot, Mode=OneWay}" />
<Setter Property="go:SpotPanel.Alignment" Value="Center" />
<Setter Property="Width" Value="{Binding ElementName=Container, Path=ActualWidth, Mode=OneWay}" />
<Setter Property="Height" Value="{Binding ElementName=Container, Path=ActualHeight, Mode=OneWay}" />
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Rectangle Width="7" Height="7" Fill="Green"
StrokeThickness="1"
Stroke="Green"
go:Node.PortId="{Binding Path=ID, Mode=OneWay}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<go:SpotPanel VerticalAlignment="Center" HorizontalAlignment="Center"
Width="{Binding ElementName=Container, Path=Width, Mode=OneWay}"
Height="{Binding ElementName=Container, Path=Height, Mode=OneWay}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</go:SpotPanel>
Here’s what the ports look like: