Linkshape in usercontrol

I need to have a usercontrol that contains multiple linkshapes. But when I declare such control within a linkpanel the link is not rendered correctly. If i declare the multiple linkshapes directly on the linkpanel then it works fine. Any way to get around thi issue?

Why do you need to have multiple link shapes in a UserControl?

I suspect it won’t work to put the LinkPanel inside your UserControl so that it can be a proper parent of the LinkShapes, but I’m not certain that that will work either.

I am trying to create a pipe control. I also reproduced this problem in the goxam pipe sample. If you just “wrap” the three linkshapes to create the pipe in a Grid (non even a custon control) then the rendering is all off.

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”><DataTemplate x:Key=“PipeTemplate”><?: prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”>
<go:LinkPanel go:Part.Reshapable=“True” go:Part.DropOntoBehavior=“SplicesIntoLink”

<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> <go:Link.Route><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> <go:Route Routing=“AvoidsNodes” Curve=“JumpOver” Corner=“5”<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”>
FromEndSegmentDirection=“RotatedNodeOrthogonal”<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”>
ToEndSegmentDirection=“RotatedNodeOrthogonal”<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”>
RelinkableFrom=“True” RelinkableTo=“True”<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> ToShortLength=“5”
/>
<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> </go:Link.Route><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> <Grid><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> <go:LinkShape Stroke="{Binding Path=Link.IsDropOntoAccepted,
Converter
={StaticResource theStrokeChooser}}" StrokeThickness=“7”
/>
<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> <go:LinkShape Stroke=“Gray” StrokeThickness=“5” /><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> <go:LinkShape Stroke=“WhiteSmoke” StrokeThickness=“3” /><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> <Path go:LinkPanel.ToArrow=“Triangle” Fill=“Black”
/>
<o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> </Grid><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”> </go:LinkPanel><o:p></o:p>

<p style=“margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;” =“Msonormal”>
</DataTemplate><o:p></o:p>

Yes, a LinkShape has to be an immediate child of a LinkPanel (or else it must be the only element of a Link).

Links are different from most kinds of FrameworkElements because of their dependence on other elements to determine their position, size and shape.