Hello,
I’ve got a Problem concerning the look from a link that originates in a Center spot. As you can see in the screenshot, the link Shows up also inside the from node. I tried to stick Close to the draggable link example since I saw that this example does what I would like to have, but I have missed sth. important in the Definition of the node template, it seems.
Perhaps you have an idea what I’m doing wrong.
Thanks in advance,
Marc
Here’s the node template:
<DataTemplate x:Key="">
<go:SpotPanel Style="{StaticResource SpotPanelStyle}"
go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"
go:Node.LocationSpot="Center">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<command:EventToCommand Command="{Binding Path=DataContext.NodeMouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type designer:GoWpfUserControl}}, Mode=OneWay}" CommandParameter="{Binding Data}"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<command:EventToCommand Command="{Binding Path=DataContext.NodeMouseLeaveCommand, RelativeSource={RelativeSource AncestorType={x:Type designer:GoWpfUserControl}}, Mode=OneWay}" CommandParameter="{Binding Data}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<go:NodePanel Background="{Binding Path=Node.IsSelected, Converter={StaticResource theSelectedBrushConverter}}">
<Border BorderThickness="1" Padding="5,0,5,0" CornerRadius="3" BorderBrush="DarkBlue">
<StackPanel MinWidth="100"
Width="150"
MinHeight="50"
Name="GoStackPanel"
go:Node.PortId="" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" Cursor="Hand">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.ColumnSpan="2" FontSize="11" FontWeight="Bold" Text="{Binding Data.Label}" TextAlignment="Center" VerticalAlignment="Center"/>
<Image Grid.Column="1" HorizontalAlignment="Right" Width="20" Height="20"
Visibility="{Binding Path=Data.IsCommissioningRelated, Converter={StaticResource BooleanToVisibilityConverter}}">
<Image.Source>
<BitmapImage UriSource="/MasterData/Workflow/Designer/Resources/shoppingcart.ico"/>
</Image.Source>
</Image>
</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 ItemsSource="{Binding Data.WsdeStwsAssignments}">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock FontSize="10" Text="{Binding Label}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Expander>
</StackPanel>
</Border>
</go:NodePanel>
<!-- 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. -->
<!-- top -->
<Ellipse Style="{StaticResource EllipseStyle}"
Stroke="{Binding Path=Data.PortsVisible, Converter={StaticResource theBooleanBrushConverter}}"
go:Node.PortId="PortTop"
go:Node.LinkableFrom="False"
go:Node.ToSpot="MiddleTop"
go:SpotPanel.Spot="MiddleTop"
go:SpotPanel.Alignment="MiddleTop"
go:Node.LinkableSelfNode="True"/>
<!-- bottom -->
<Ellipse Style="{StaticResource EllipseStyle}"
Stroke="{Binding Path=Data.PortsVisible, Converter={StaticResource theBooleanBrushConverter}}"
go:Node.PortId="PortBottom"
go:Node.LinkableTo="False"
go:Node.FromSpot="MiddleBottom"
go:SpotPanel.Spot="MiddleBottom"
go:SpotPanel.Alignment="MiddleBottom"
go:Node.LinkableSelfNode="True"/>
<!-- left side -->
<Ellipse Style="{StaticResource EllipseStyle}"
Stroke="{Binding Path=Data.PortsVisible, Converter={StaticResource theBooleanBrushConverter}}"
go:Node.PortId="PortLeft"
go:Node.FromSpot="MiddleLeft"
go:Node.ToSpot="MiddleLeft"
go:Node.FromEndSegmentLength="50"
go:Node.ToEndSegmentLength="50"
go:SpotPanel.Spot="MiddleLeft"
go:SpotPanel.Alignment="MiddleLeft"/>
<!-- right side -->
<Ellipse Style="{StaticResource EllipseStyle}"
Stroke="{Binding Path=Data.PortsVisible, Converter={StaticResource theBooleanBrushConverter}}"
go:Node.PortId="PortRight"
go:Node.FromSpot="MiddleRight"
go:Node.ToSpot="MiddleRight"
go:Node.FromEndSegmentLength="50"
go:Node.ToEndSegmentLength="50"
go:SpotPanel.Spot="MiddleRight"
go:SpotPanel.Alignment="MiddleRight"/>
</go:SpotPanel>
</DataTemplate>
And here the screenshot: