I created a line to show the grid bottom line and it worked if I placed it on the page.xaml. I need to change the line during Orentiation, so I created a style on app.xaml. However it has Application_UnhandledException error.
There is the code I used without sytle on the page and it work. Would someone show me how to make it work. Thanks in advance.
<Line X1="0" X2="700" Y1="0" Y2="0" Grid.Row="0" Grid.ColumnSpan="3" Grid.Column="0"
VerticalAlignment="Bottom" Stroke="Blue" StrokeThickness="5"/>
The following is the style for line on app.xaml
<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>
I checked the code again and again. Finally I know why I got the error because I used the RelativeSource. It should be “StaticResource” for style in my page.