我正在尝试显示我在 wpf 中设计的多个用户控件,但它们的行显示不正确
有一张图片来描述这个问题:
这是我用于绘制线条的 xaml 代码:
<Line Grid.Row="1" X1="30" Y1="20" X2="340" Y2="20" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="30" Y1="35" X2="340" Y2="35" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="30" Y1="50" X2="340" Y2="50" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="30" Y1="65" X2="340" Y2="65" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="30" Y1="80" X2="340" Y2="80" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="30" Y1="95" X2="340" Y2="95" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="30" Y1="110" X2="340" Y2="110" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="30" Y1="10" X2="30" Y2="110" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="99" Y1="10" X2="99" Y2="110" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="177" Y1="10" X2="177" Y2="110" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="256" Y1="10" X2="256" Y2="110" Stroke="LightCyan" StrokeThickness="0.1"/>
<Line Grid.Row="1" X1="340" Y1="10" X2="340" Y2="110" Stroke="LightCyan" StrokeThickness="0.1"/>
它是一个简单的代码,我在这里找不到问题...
奇怪的是,当我调整窗口大小时,它有时会正确显示线条。