<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      x:Name="page"
      x:Class="ForzaUI.Scenes.Anthem.AR_SpeedCamera"
      mc:Ignorable="d"
      Height="310"
      Width="658"
      VerticalAlignment="Center"
      HorizontalAlignment="Center"
      RenderTransformOrigin="0.5,0.5">
    <Page.Resources>

        <Storyboard x:Key="TransitionIn">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="grid">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="0" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.4"
                                      Value="1" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Color x:Key="A_Color_DropShadow">#33000000</Color>
        <Color x:Key="A_Color_ARUITetherLine">#66FFFFFF</Color>
        <Style x:Key="A_Style_ARUITetherLine"
               TargetType="{x:Type Rectangle}">
            <Setter Property="Width"
                    Value="4" />
            <Setter Property="Fill">
                <Setter.Value>
                    <SolidColorBrush Color="{StaticResource A_Color_ARUITetherLine}" />
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="A_Style_SpeedCamGamerTag"
               TargetType="{x:Type TextBlock}">
            <Setter Property="FontSize"
                    Value="40" />
            <Setter Property="FontFamily"
                    Value="Anthem_B" />
            <Setter Property="Foreground"
                    Value="White" />
        </Style>
        <Style x:Key="A_Style_SpeedCamScore"
               TargetType="{x:Type TextBlock}"
               BasedOn="{StaticResource A_Style_SpeedCamGamerTag}">
            <Setter Property="FontSize"
                    Value="40" />
            <Setter Property="FontFamily"
                    Value="Anthem_A" />
        </Style>
        <BooleanToVisibilityConverter x:Key="BoolVisConverter" />
        <local:FZBooleanToVisibilityConverter x:Key="InverseBoolVisConverter"
                                              InvertResult="true" />

    </Page.Resources>

    <Grid x:Name="grid"
          Style="{StaticResource A_Style_ScreenSize}">
        <Grid.LayoutTransform>
            <TransformGroup>
                <ScaleTransform ScaleX=".25" ScaleY=".25"/>
                <RotateTransform />
                <TranslateTransform />
            </TransformGroup>
        </Grid.LayoutTransform>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="1"
                  Margin="0,-10,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="42" />
                    <RowDefinition Height="50" />
                    <RowDefinition Height="180" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="10" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Rectangle Grid.RowSpan="2"
                           Width="80"
                           Height="80"
                           HorizontalAlignment="Right"
                           Visibility="{Binding ShowCustomIcon, Converter={StaticResource BoolVisConverter}}">
                    <Rectangle.Fill>
                        <ImageBrush ImageSource="{Binding CustomIconPath}"
                                    Stretch="Uniform" />
                    </Rectangle.Fill>
                </Rectangle>
                <Canvas Margin="3,10,0,0" 
                        Grid.Column="1"
                        Grid.RowSpan="3">
                <Rectangle Style="{StaticResource A_Style_ARUITetherLine}"
                           HorizontalAlignment="Center"
                           Height="{Binding Height}"/>
                </Canvas>
                <TextBlock Text="{Binding UserProfile.FormattedGamertag}"
                           Grid.Column="2"
                           Style="{StaticResource A_Style_SpeedCamGamerTag}" />
                <TextBlock Text="{Binding ScoreText}"
                           Grid.Row="1"
                           Grid.Column="2"
                           Style="{StaticResource A_Style_SpeedCamScore}" />
            </Grid>
        </Grid>
    </Grid>
</Page>
