<StackPanel Margin="20">
<Line StrokeDashArray="4 4" Stroke="Red" X1="0" Y1="0" X2="{Binding LeftPoint}" Y2="{Binding TopPoint}"></Line>
<TextBlock Text="Hello"></TextBlock>
<Border Height="100"></Border>
<Canvas Name="B" >
<Border Height="48"></Border>
<TextBlock Canvas.Left="{Binding LeftPoint, Mode=TwoWay}" Canvas.Top="{Binding TopPoint, Mode=TwoWay}" Text="World"></TextBlock>
</Canvas>
</StackPanel>
上面是代码示例,没有从 hello 到 world 画线。我想保留结构并且仍然能够画线。
请建议。