<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。我想保留结构,仍然能够划线。
请建议。
答案 0 :(得分:0)
我猜你错过了StrokeThickness
:
<Line StrokeDashArray="4 4"
Stroke="Red" StrokeThickness="1"
X1="0" X2="{Binding LeftPoint}"
Y1="0" Y2="{Binding TopPoint}"/>