<Page xmlns:local="clr-namespace:ForzaUI"
      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:System="clr-namespace:System;assembly=mscorlib"
      x:Class="ForzaUI.A_PostRaceRivalsChallengeChoice"
      mc:Ignorable="d"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_PostRace}"/>
    </local:UIPageTransitionManager.TransitionManager>

    <Grid>
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="PART_DefaultHelpPanel"
                    Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>

        <Decorator Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <Grid>
                <StackPanel Style="{StaticResource H_Style_PostRaceContainer}"
                            VerticalAlignment="Bottom"
                            HorizontalAlignment="Left"
                            Margin="92,160">
                    <Grid Margin="0,0,6,0"
                          Style="{StaticResource H_Style_PostRaceItalicise}">
                        <local:FZTextBlock Style="{StaticResource H_Style_PostRace_TitleText}"
                                           Visibility="{Binding IsRivalAvailable, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"
                                           Text="{local:Loc InGame.IDS_Rival_DownloadingRival}" 
                                           CapHeight="107"/>
                        <local:FZTextBlock Style="{StaticResource H_Style_PostRace_TitleText}"
                                           Visibility="{Binding IsRivalAvailable, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                           Text="{Binding WantToRaceMessage}" 
                                           CapHeight="107"/>
                    </Grid>
                    <StackPanel Margin="40,0,0,0">
                        <StackPanel.Style>
                            <Style TargetType="FrameworkElement">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsRivalInitiallyAvailable}" Value="False">
                                        <Setter Property="Opacity" Value="0" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding IsRivalAvailable}" Value="True">
                                        <Setter Property="Opacity" Value="1" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </StackPanel.Style>
                        <ContentControl Template="{StaticResource A_Template_Control_ShadowMaterial}" 
                                        HorizontalAlignment="Left"
                                        Margin="0,22,0,7"
                                        Content="{Binding UserProfile}"
                                        ContentTemplate="{StaticResource H_DataTemplate_PostRaceUserProfile}"/>
                        <HeaderedContentControl x:Name="Content"
                                                HorizontalAlignment="Left"
	                                            Style="{StaticResource H_Style_HeaderedContentControl_PostRaceRow}"
	                                            Header="{local:Loc InGame.IDS_Rival_Target}"
	                                            ContentTemplate="{Null}"
                                                MinWidth="528"
                                                Width="Auto">
                            <DockPanel HorizontalAlignment="Center"
                                       Margin="15,0">
                                <StackPanel DockPanel.Dock="Left"
                                            Orientation="Horizontal">
                                    <local:FZTextBlock Text="{Binding TargetTime}" 
                                                    VerticalAlignment="Center"
                                                    HorizontalAlignment="Right"
                                                    CapHeight="20"
                                                    Color="{StaticResource H_Color_Primary_Yellow}" />
                                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_RivalDirtyIcon}"
                                                    Tag="{Binding TargetTimeIsDirty}" />
                                </StackPanel>
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_HorizonF}"
                                                   Visibility="{Binding TargetSplit, Converter={StaticResource A_StringVisConverter}}"
                                                   Text="{Binding TargetSplit}" 
                                                   VerticalAlignment="Center"
                                                   CapHeight="20"
                                                   Margin="29,0,0,0"
                                                   Color="{StaticResource H_Color_Primary_Green}" 
                                                   DockPanel.Dock="Right"/>
                            </DockPanel>
                        </HeaderedContentControl>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Decorator>
    </Grid>
</Page>
