0
 <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 画线。我想保留结构并且仍然能够画线。

请建议。

4

1 回答 1

0

我猜你错过了StrokeThickness

 <Line StrokeDashArray="4 4" 
       Stroke="Red" StrokeThickness="1"
       X1="0" X2="{Binding LeftPoint}"
       Y1="0" Y2="{Binding TopPoint}"/>
于 2013-09-16T14:41:50.890 回答