GoWPF 3.0.3 - Draw a simpple link in a user control for previewing reaons

Hi Walter,

i need to create an application, where a user can create different kinds of “Links”. - Each kind is different in styling, for example red line or green line, or different arrow heads and so on.

Anyway, the operator has a dialog where he can create such visual templates for link, and there i want to simply demonstrate the visual appearance of the configured link. - No matter what i do, the link is not rendered.

This is my sample, but i cant make it getting rendered. - Can you let me know what i am making wrong? - I simply want to show a link in a Grid control, without using the Diagram control.

                <!-- Link type preview-->
                <Viewbox Grid.Column="1" Margin="20">
                    <go:LinkPanel MinWidth="20" Width="20" MinHeight="20" Height="20" Background="Yellow">

                        <go:Link.Route>
                            <go:Route Routing="Normal" 
                                      Curve="Bezier" Points="0,0 20,20" 
                                      Adjusting="None"
                                      FromEndSegmentDirection="Absolute"
                                      ToEndSegmentDirection="Absolute" />
                        </go:Link.Route>

                        <!--This is the from-arrow which should be at pos 0,0-->
                        <Path Fill="Black" go:LinkPanel.FromArrow="None" go:LinkPanel.FromArrowScale="1" />

                        <!--This is the actual from-to path which should run from 0,0 to 20,20-->
                        <go:LinkShape x:Name="Path" Stroke="Black" StrokeThickness="1" />

                        <!--This is the to-arrow whi should be at pos 20,20-->
                        <Path Fill="Black" go:LinkPanel.ToArrow="Standard" go:LinkPanel.ToArrowScale="1" />

                        <!--Template text-->
                        <Viewbox>
                            <TextBlock Margin="2" Text="Testlink" TextWrapping="Wrap"
                                           Foreground="Black"
                                           HorizontalAlignment="Center" 
                                       VerticalAlignment="Center" />
                        </Viewbox>
                    </go:LinkPanel>
                </Viewbox>

Many thanks meanwhile, Hannes

I haven’t tried this, but I suspect that the problems are that there isn’t any DiagramPanel to force the Link to be routed, and that even if there were there are no connected Nodes with known locations to allow the route to be computed.

So I suggest that you explicitly provide a geometry for the LinkShape path. You might need to replace the LinkShape with a Path element.