我创建了一条线来显示网格的底线,如果我把它放在page.xaml上,它就会起作用。我需要在口述过程中更改线条,所以我在app.xaml上创建了一个样式。然而,它有Application_UnhandledException错误。这是我在页面上没有使用sytle时使用的代码,它可以正常工作。谁能教我怎么使它工作。提前谢谢。
<Line X1="0" X2="700" Y1="0" Y2="0" Grid.Row="0" Grid.ColumnSpan="3" Grid.Column="0"
VerticalAlignment="Bottom" Stroke="Blue" StrokeThickness="5"/>以下是app.xaml上line的样式
<Style x:Key="queuePortraitLine" TargetType="Line">
<Setter Property="X1" Value="0"/>
<Setter Property="X2" Value="700"/>
<Setter Property="Y1" Value="0"/>
<Setter Property="Y2" Value="0"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Stroke" Value="Blue"/>
<Setter Property="StrokeThickness" Value="5"/>
</Style>发布于 2013-01-17 03:25:05
我一遍又一遍地检查代码。最后,我知道为什么会出现这个错误,因为我使用了RelativeSource。它应该是"StaticResource“的风格在我的页面。
https://stackoverflow.com/questions/14059984
复制相似问题