0

我创建了一条线来显示网格底线,如果我将它放在page.xaml. 我需要在 Orientation 期间更改线条,所以我在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>
4

1 回答 1

0

我一次又一次地检查代码。最后我知道为什么我得到了错误,因为我使用了RelativeSource。我的页面中的样式应该是“StaticResource”。

于 2013-01-16T19:25:04.787 回答