<Page HorizontalAlignment="Center"
      RenderTransformOrigin="0.5,0.5"
      VerticalAlignment="Center"
      mc:Ignorable="d"
      x:Class="ForzaUI.Scenes.Anthem.AR_EliminatorLootActivation"
      x:Name="page"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:ForzaUI="clr-namespace:ForzaUI;assembly="
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Style="{StaticResource A_PageStyle_AR_Activation}">
    <Page.Resources>
        <Color x:Key="A_Color_ActivationPreNameText">#FF00FFEF</Color>
        <Color x:Key="A_Color_ActivationNameText">#FFFFFFFF</Color>
        <Style TargetType="{x:Type local:FZTextBlock}"
               x:Key="A_Style_ActivationNameTextTop" 
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonC}">
            <Setter Property="Color"
                    Value="{StaticResource A_Color_ActivationNameText}"/>
            <Setter Property="FontSize"
                    Value="78" />
        </Style>
        <Style TargetType="{x:Type local:FZTextBlock}"
               x:Key="A_Style_ActivationNameTextBottom" 
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="Color"
                    Value="{StaticResource A_Color_ActivationNameText}"/>
            <Setter Property="FontSize"
                    Value="68" />
        </Style>
        <Style BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}"
               TargetType="{x:Type local:FZTextBlock}"
               x:Key="A_Style_ActivationPreNameText">
            <Setter Property="FontSize"
                    Value="54" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_ActivationPreNameText}"/>
        </Style>
        <Style TargetType="{x:Type local:FZMaterial}"
               x:Key="A_Style_ARUITetherLine">
            <Setter Property="Width"
                    Value="4" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_Tile_Background}" />
        </Style>
        <Style TargetType="{x:Type local:FZRun}"
               x:Key="A_Style_Run_ActivationName_0">
            <Setter Property="FontFamily"
                    Value="Horizon_B"/>
        </Style>
        <QuarticEase x:Key="A_EasingFunction_EaseInOut" EasingMode="EaseInOut" />
        <QuarticEase x:Key="A_EasingFunction_EaseOut" EasingMode="EaseOut" />
        <QuarticEase x:Key="A_EasingFunction_EaseIn" EasingMode="EaseIn" />
        <local:UIStoryboard DurationOverride="0:0:2.5"
                            x:Key="A_Storyboard_AR_Appear">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LongStalk"
                                           Storyboard.TargetProperty="Tag">
                <DiscreteDoubleKeyFrame KeyTime="0"
                                      Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.8"
                                      Value="0"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseOut}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopValue"
                                           Storyboard.TargetProperty="Tag"
                                           FillBehavior="Stop">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                      Value="0"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopValue2"
                                           Storyboard.TargetProperty="Tag"
                                           FillBehavior="Stop">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                      Value="0"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopIconContainer"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="0.01" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                      Value="1"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopIconContainer"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="0.01" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                      Value="1"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                               Storyboard.TargetName="Arrow">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                      Value="0"
                                      EasingFunction="{local:QuarticEasing EasingMode=EaseOut}"/>
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>
        <local:UIStoryboard x:Key="A_Storyboard_AR_Abandon"
                            DurationOverride="0:0:0.3">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="page"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                <EasingDoubleKeyFrame KeyTime="0:0:1"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="page"
                                            Storyboard.TargetProperty="DataContext.Complete">
                <DiscreteBooleanKeyFrame KeyTime="0:0:1"
                                         Value="True" />
            </BooleanAnimationUsingKeyFrames>
        </local:UIStoryboard>
        <Storyboard x:Key="A_Storyboard_AR_Discover">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopValue"
                                           Storyboard.TargetProperty="Tag">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.9"
                                      Value="0"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopValue"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.2"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopValue2"
                                           Storyboard.TargetProperty="Tag">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                      Value="0"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopValue2"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.3"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <CornerRadius x:Key="A_SmallCornerRadius_Outer_All_Bar">4</CornerRadius>
        <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll_Bar"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            CornerRadius="{StaticResource A_SmallCornerRadius_Outer_All_Bar}"/>

        <Style x:Key="A_Style_FZMaterial_LineDivider" TargetType="local:FZMaterial">
            <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll_Bar}"/>
            <Setter Property="Height" Value="8"/>
            <Setter Property="Width" Value="Auto"/>
            <Setter Property="Color" Value="{Binding CarInfo.CarGrade, Converter={StaticResource A_Converter_Grade_To_BaseColor}}"/>
        </Style>

        <!-- Any position overrides for the spatial icons need to live in here. -->
        <local:MappingConverter x:Key="A_MappingConverter_FZMaterial_Margin_FromDataType" Default="0,0,0,0">
            <local:MappingConverterEntry Key="{x:Type local:DeprecatedAugmentedRealityDataSource}" Value="0,0,0,0" />
        </local:MappingConverter>

        <local:MultiConverter x:Key="A_Converter_MediumLengthUnit">
            <local:MultiConverterEntry Converter="{StaticResource A_NumUnitConverter_ShowUnit_0dp}" Parameter="medium_length" />
            <local:MultiConverterEntry Converter="{StaticResource A_StringToUpper}"/>
        </local:MultiConverter>

        <GridLength x:Key="A_GridLength_SpatialLineSpacing">24</GridLength>
        <GridLength x:Key="A_GridLength_SpatialLineSpacing_CHS">34</GridLength>
        <GridLength x:Key="A_GridLength_SpatialLineSpacing_CHT">34</GridLength>
        <GridLength x:Key="A_GridLength_SpatialLineSpacing_JP">34</GridLength>
        <GridLength x:Key="A_GridLength_SpatialLineSpacing_KO">34</GridLength>

    </Page.Resources>
    <Page.LayoutTransform>
        <TransformGroup>
            <ScaleTransform />
            <SkewTransform />
            <RotateTransform />
            <TranslateTransform />
        </TransformGroup>
    </Page.LayoutTransform>
    <Grid HorizontalAlignment="Center"
          VerticalAlignment="Center"
          Height="1080">

        <Grid.RenderTransform>
            <TranslateTransform Y="540"/>
        </Grid.RenderTransform>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="175"/>
            <RowDefinition Height="78"/>
            <RowDefinition Height="{local:LocalizedResource A_GridLength_SpatialLineSpacing}"/>
            <RowDefinition Height="2"/>
            <RowDefinition Height="{local:LocalizedResource A_GridLength_SpatialLineSpacing}"/>
            <RowDefinition Height="60"/>
            <RowDefinition Height="68"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Decorator HorizontalAlignment="Center" 
                   VerticalAlignment="Stretch" 
                   Grid.Row="0" 
                   RenderTransformOrigin="0.5,0.5"
                   Margin="{Binding AugmentedRealityData.ObjectType, Converter={StaticResource A_MappingConverter_FZMaterial_Margin_FromDataType}}"
                   x:Name="TopIconContainer">
            <Decorator.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <TranslateTransform/>
                    <RotateTransform/>
                </TransformGroup>
            </Decorator.RenderTransform> 
            <ContentControl x:Name="PART_TopIcon"
                        Content="{Binding AugmentedRealityData}"
                        Style="{StaticResource A_Style_ContentControl_SpatialIcon_ForAR}"
                        RenderTransformOrigin="0.5,0.5"
                        Visibility="{Binding ShownOnHUD, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden_Inverse}}">
                <ContentControl.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <TranslateTransform/>
                        <RotateTransform/>
                    </TransformGroup>
                </ContentControl.RenderTransform>
            </ContentControl>
        </Decorator>

        <Grid Grid.Column="1"
              Grid.Row="7">

            <ContentControl x:Name="LongStalk"
                            Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromTop}"
                            VerticalAlignment="Top"
                            Margin="0,7,0,0">
                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures\Anthem\Gradients\SpatialStalk.png"
                                      Height="{Binding Height}"
                                      Margin="0,0,0,0"
                                      Width="8" />
            </ContentControl>
        </Grid>

        <ContentControl x:Name="TopValue"
                        Grid.Row="1" VerticalAlignment="Bottom"
                        Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromBottom}">
            <Decorator LayoutTransform="{StaticResource A_Transform_Italic}" HorizontalAlignment="Center">
                <local:FZTextBlock Style="{StaticResource A_Style_ActivationNameTextTop}" Margin="3,2,0,2"
                                   Visibility="{Binding AugmentedRealityData.CarInfo.CarDisplayName, Converter={StaticResource A_StringVisConverter}}"
                                   Text="{Binding AugmentedRealityData.CarInfo.CarDisplayName, Converter={StaticResource A_StringToUpper}}"/>
            </Decorator>
        </ContentControl>

        <local:FZMaterial Grid.Column="1" Grid.Row="3" Style="{StaticResource A_Style_FZMaterial_LineDivider}" DataContext="{Binding AugmentedRealityData}" Margin="-20,0" />

        <ContentControl x:Name="TopValue2"
                        Grid.Column="1" Margin="0,6,0,0"
                        Grid.Row="5"  VerticalAlignment="Top"
                        Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromTop}">
            <Decorator LayoutTransform="{StaticResource A_Transform_Italic}"  HorizontalAlignment="Center">
                <local:FZTextBlock Style="{StaticResource A_Style_ActivationNameTextBottom}"  Margin="3,2,0,2"
                                   Visibility="{Binding AugmentedRealityData.Distance, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                   local:TextBlockInlineMarkup.Markup="{Binding AugmentedRealityData.Distance, Converter={StaticResource A_Converter_MediumLengthUnit}}"
                                   local:TextBlockInlineMarkup.ResourceBaseName="A_Style_Run_ActivationName_"/>
            </Decorator>
        </ContentControl>

        <ContentControl x:Name="Arrow" Grid.Column="1" Grid.Row="6"  Margin="0,24,0,24"
                        Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromTop}">
            <local:FZMaterial Color="{StaticResource A_Color_White}"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Top"
                                  Width="50"
                                  Height="25"
                                  Data="{StaticResource A_Geometry_Spatial_DownArrow}">
            </local:FZMaterial>
        </ContentControl>
    </Grid>
</Page>
