Jef*_*cox 6 silverlight xaml line
是否可以在XAML中创建一个Line(后面没有任何C#代码)来对齐一个布局容器(如Grid)中的一行?
我想有效地:
<Grid>
<Line StrokeThickness="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Stroke="Red"/>
</Grid>
Run Code Online (Sandbox Code Playgroud)
我需要使用StrokeDashArray和StrokeDashOffset,否则,我只想用一个Border设置在了borderThickness控制"0,0,0,1"...
谢谢你的任何想法!
Gab*_*abe 10
要详细说明kanchirk的回应,这对我有用:
<Path StrokeThickness="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Data="M0,0 L1,0"
Stretch="Fill"
StrokeEndLineCap="Square"
StrokeStartLineCap="Square"
Stroke="Red"/>
Run Code Online (Sandbox Code Playgroud)
你也可以用同样的东西Line:
<Line StrokeThickness="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
X2="1"
Stretch="Fill"
StrokeEndLineCap="Square"
StrokeStartLineCap="Square"
Stroke="Red"/>
Run Code Online (Sandbox Code Playgroud)