<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_SeriesRewards"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Margin="0">
    <Page.Resources>
        <ResourceDictionary>
            <Style x:Key="A_Style_Icon" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="68"/>
                <Setter Property="Height" Value="68"/>
                <Setter Property="Stretch" Value="Uniform"/>
            </Style>

            <Style x:Key="A_Style_FZRun_BOLD" TargetType="local:FZRun">
                <Setter Property="FontFamily" Value="Horizon_C" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_SeriesRewards_Base" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="FontFamily" Value="Horizon_A"/>
                <Setter Property="TextWrapping" Value="NoWrap"/>
                <Setter Property="FontSize" Value="18"/>
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
            </Style>
            
            <CornerRadius x:Key="A_SmallCornerRadius_Outer_All">3</CornerRadius>
            <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_Line_OuterAll_Small"
                BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                CornerRadius="{StaticResource A_SmallCornerRadius_Outer_All}"/>

            <Style x:Key="A_Style_FZMaterial_EmptyTile_Outline" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_Tile_PreviewReward}">
                <Setter Property="Width" Value="178"/>
                <Setter Property="Height" Value="178"/>
                <Setter Property="Margin" Value="0,0,8,0"/>
                <Setter Property="Color" Value="#33FFFFFF"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_Divider" TargetType="local:FZMaterial">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Data_Bound/SeriesRewards/Gold_Divider.png"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding HasAchievedLeagueRank}" Value="False">
                        <Setter Property="Opacity" Value="0.5"/>
                        <Setter Property="ImageSource" Value="{x:Null}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <local:MappingConverter x:Key="A_Converter_League_ID_To_LeagueEmblemShadow" Default="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_Unranked_Shadow.png">
                <local:MappingConverterEntry Key="20" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_1_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="19" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_1_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="18" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_1_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="17" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_1_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="16" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_1_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="15" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_2_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="14" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_2_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="13" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_2_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="12" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_2_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="11" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_2_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="10" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_3_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="9" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_3_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="8" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_3_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="7" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_3_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="6" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_3_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="5" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_4_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="4" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_4_Shadow_Small.png"/>
                <local:MappingConverterEntry Key="3" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_4_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="2" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_4_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="1" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_4_Shadow_Large.png"/>
                <local:MappingConverterEntry Key="0" Value="/ForzaUI;component/Textures/Data_Bound/LeagueIcon/Big/Tier_Grandmaster_Shadow.png"/>
            </local:MappingConverter>

            <Color x:Key="A_Color_LeagueLabel_GoldText">#BF000000</Color>

            <ControlTemplate x:Key="A_ControlTemplate_League_Label" TargetType="Control">
                <local:FZMaterial x:Name="LeagueNamePill" Height="58" Width="196" ImageSource="/ForzaUI;component/Textures/Data_Bound/SeriesRewards/Gold_Plaque.png">
                    <Decorator x:Name="ItalicHandler"  RenderTransform="{StaticResource A_Transform_Italic}" VerticalAlignment="Center" HorizontalAlignment="Center">
                        <local:FZTextBlock x:Name="LeagueName" local:TextBlockInlineMarkup.Markup="{Binding LeagueRank, Converter={StaticResource A_Converter_League_ID_To_LeagueName}}" local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_" Color="{StaticResource A_Color_LeagueLabel_GoldText}" FontFamily="HorizonA" CapHeight="15"/>
                    </Decorator>
                </local:FZMaterial>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding HasAchievedLeagueRank}" Value="False">
                        <Setter TargetName="ItalicHandler" Property="RenderTransform" Value="{x:Null}"/>
                        <Setter TargetName="LeagueName" Property="Color" Value="{StaticResource A_Color_White}"/>
                        <Setter TargetName="LeagueNamePill" Property="Color" Value="#40000000"/>
                        <Setter TargetName="LeagueNamePill" Property="ImageSource" Value="{x:Null}"/>
                        <Setter TargetName="LeagueNamePill" Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}"/>
                        <Setter TargetName="LeagueNamePill" Property="Height" Value="32" />
                        <Setter TargetName="LeagueNamePill" Property="Width" Value="170" />
                        <Setter Property="Margin" Value="0,0,0,10"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <CornerRadius x:Key="A_CornerRadius_Series_Rewards">12</CornerRadius>
            <CornerRadius x:Key="A_CornerRadius_Series_Rewards_Highlight">16</CornerRadius>

            <local:FZMaterialPresetRoundtangle x:Key="A_Preset_FZMaterial_Gradient_Tier1_OuterLeft" BasedOn="{StaticResource A_Preset_FZMaterial_Gradient_Tier_1}" CornerRadius="{StaticResource A_CornerRadius_Outer_Left}"/>
            <local:FZMaterialPresetRoundtangle x:Key="A_Preset_FZMaterial_Gradient_Tier2_OuterLeft" BasedOn="{StaticResource A_Preset_FZMaterial_Gradient_Tier_2}" CornerRadius="{StaticResource A_CornerRadius_Outer_Left}"/>
            <local:FZMaterialPresetRoundtangle x:Key="A_Preset_FZMaterial_Gradient_Tier3_OuterLeft" BasedOn="{StaticResource A_Preset_FZMaterial_Gradient_Tier_3}" CornerRadius="{StaticResource A_CornerRadius_Outer_Left}"/>
            <local:FZMaterialPresetRoundtangle x:Key="A_Preset_FZMaterial_Gradient_Tier4_OuterLeft" BasedOn="{StaticResource A_Preset_FZMaterial_Gradient_Tier_4}" CornerRadius="{StaticResource A_CornerRadius_Outer_Left}"/>
            <local:FZMaterialPresetRoundtangle x:Key="A_Preset_FZMaterial_Gradient_Tier_Grandmaster_OuterLeft" BasedOn="{StaticResource A_Preset_FZMaterial_Gradient_Tier_Grandmaster}" CornerRadius="{StaticResource A_CornerRadius_Outer_Left}"/>
            <local:FZMaterialPresetRoundtangle x:Key="A_Preset_FZMaterial_Gradient_Tier_Unranked_OuterLeft" BasedOn="{StaticResource A_Preset_FZMaterial_Gradient_Tier_Unranked}" CornerRadius="{StaticResource A_CornerRadius_Outer_Left}"/>

            <local:MappingConverter x:Key="A_Converter_League_ID_To_GradientPreset_OuterLeft" Default="{StaticResource A_Preset_FZMaterial_Gradient_Tier_Unranked_OuterLeft}">
                <local:MappingConverterEntry Key="20" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier1_OuterLeft}"/>
                <local:MappingConverterEntry Key="19" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier1_OuterLeft}"/>
                <local:MappingConverterEntry Key="18" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier1_OuterLeft}"/>
                <local:MappingConverterEntry Key="17" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier1_OuterLeft}"/>
                <local:MappingConverterEntry Key="16" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier1_OuterLeft}"/>
                <local:MappingConverterEntry Key="15" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier2_OuterLeft}"/>
                <local:MappingConverterEntry Key="14" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier2_OuterLeft}"/>
                <local:MappingConverterEntry Key="13" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier2_OuterLeft}"/>
                <local:MappingConverterEntry Key="12" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier2_OuterLeft}"/>
                <local:MappingConverterEntry Key="11" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier2_OuterLeft}"/>
                <local:MappingConverterEntry Key="10" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier3_OuterLeft}"/>
                <local:MappingConverterEntry Key="9" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier3_OuterLeft}"/>
                <local:MappingConverterEntry Key="8" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier3_OuterLeft}"/>
                <local:MappingConverterEntry Key="7" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier3_OuterLeft}"/>
                <local:MappingConverterEntry Key="6" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier3_OuterLeft}"/>
                <local:MappingConverterEntry Key="5" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier4_OuterLeft}"/>
                <local:MappingConverterEntry Key="4" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier4_OuterLeft}"/>
                <local:MappingConverterEntry Key="3" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier4_OuterLeft}"/>
                <local:MappingConverterEntry Key="2" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier4_OuterLeft}"/>
                <local:MappingConverterEntry Key="1" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier4_OuterLeft}"/>
                <local:MappingConverterEntry Key="0" Value="{StaticResource A_Preset_FZMaterial_Gradient_Tier_Grandmaster_OuterLeft}"/>
            </local:MappingConverter>

            <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_SeriesRewards_GradientHighlight_OuterAll"
                BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight}"
                CornerRadius="{StaticResource A_CornerRadius_Series_Rewards_Highlight}"/>
            <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_SeriesRewards_OuterAll"
                BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                CornerRadius="{StaticResource A_CornerRadius_Series_Rewards}"/>

            <Style x:Key="A_Style_FZMaterial_SeriesRewards_HighlightPanel" TargetType="local:FZMaterial">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_SeriesRewards_GradientHighlight_OuterAll}"/>
            </Style>
            <Style x:Key="A_Style_FZMaterial_SeriesRewards_Tile" TargetType="local:FZMaterial">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_SeriesRewards_OuterAll}"/>
                <Setter Property="Color" Value="{StaticResource A_Color_Tile_Background}"/>
            </Style>
            
            <Style x:Key="A_Style_FZMaterial_Empty_Inner_Tile" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerInnerAll}"/>
                <Setter Property="Color" Value="#99000000"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_Empty_League_Row" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_GlassPanel_Pill_NonInteractive}">
                <Setter Property="Height" Value="228"/>
                <Setter Property="Width" Value="1008"/>
                <Setter Property="Margin" Value="0,0,0,6"/>
            </Style>

            <DataTemplate x:Key="A_DataTemplate_SeriesRewardLeagueItem">
                <Grid x:Name="LeagueRowContainer" HorizontalAlignment="Left" MaxHeight="228" Width="1008" Focusable="True">
                    <local:FZMaterial x:Name="DropShadow" Opacity="0.7" Visibility="Hidden" Margin="-10,-26"
                                      Style="{StaticResource A_Style_FZMaterial_ShadowBase_ForSubgraph}"/>
                    <local:FZMaterial x:Name="StrokeBackground" Style="{StaticResource A_Style_FZMaterial_SeriesRewards_HighlightPanel}" Margin="-6.5" Visibility="Hidden"/>
                    <local:FZMaterial x:Name="BackingPanel" Width="1008" Height="228" ImageSource="/ForzaUI;component/Textures/Data_Bound/SeriesRewards/Gold_Border.png">
                        <DockPanel Margin="5.5">
                            <local:FZMaterial x:Name="LeagueIconBackground"
                                              DockPanel.Dock="Left" Preset="{Binding LeagueRank, Converter={StaticResource A_Converter_League_ID_To_GradientPreset_OuterLeft}}"
                                              VerticalAlignment="Center" HorizontalAlignment="Center" Width="218" Height="218">
                                <DockPanel>
                                    <Decorator Height="60" DockPanel.Dock="Bottom">
                                        <Control Template="{StaticResource A_ControlTemplate_League_Label}" 
                                             VerticalAlignment="Bottom"/>
                                    </Decorator>
                                    <Control x:Name="LeagueEmblem" Style="{StaticResource A_Style_Control_LeagueEmblem_Big}" 
                                             IsHitTestVisible="False"
                                             Width="180" Height="180" VerticalAlignment="Top"/>
                                </DockPanel>
                            </local:FZMaterial>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Divider}" Width="2" Height="218"/>
                            <local:FZMaterial x:Name="RewardRowBackground"
                                              Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileRight}" Color="{Binding LeagueRank,Converter={StaticResource A_Converter_League_ID_To_TierColor}}" 
                                              HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                <Grid>
                                    <local:FZMaterial Opacity="0.2" Color="#FF000000" Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileRight}"/>
                                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/SeriesRewards/Gradient_Shadow.png" VerticalAlignment="Center" HorizontalAlignment="Left" Width="27" Height="218"/>
                                    <Grid>
                                        <local:FZMaterial Width="752" Height="194" VerticalAlignment="Center" HorizontalAlignment="Center"
                                                      Color="#FF000000" Opacity="0.5" Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}"/>

                                        <StackPanel x:Name="EmptyItems" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="26,20,20,20">
                                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_EmptyTile_Outline}">
                                                <Grid>
                                                    <local:FZMaterial Margin="6" Color="{Binding LeagueRank,Converter={StaticResource A_Converter_League_ID_To_TierColor}}" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                    <local:FZMaterial Margin="6" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                </Grid>
                                            </local:FZMaterial>
                                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_EmptyTile_Outline}">
                                                <Grid>
                                                    <local:FZMaterial Margin="6" Color="{Binding LeagueRank,Converter={StaticResource A_Converter_League_ID_To_TierColor}}" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                    <local:FZMaterial Margin="6" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                </Grid>
                                            </local:FZMaterial>
                                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_EmptyTile_Outline}">
                                                <Grid>
                                                    <local:FZMaterial Margin="6" Color="{Binding LeagueRank,Converter={StaticResource A_Converter_League_ID_To_TierColor}}" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                    <local:FZMaterial Margin="6" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                </Grid>
                                            </local:FZMaterial>
                                            <local:FZMaterial  Style="{StaticResource A_Style_FZMaterial_EmptyTile_Outline}">
                                                <Grid>
                                                    <local:FZMaterial Margin="6" Color="{Binding LeagueRank,Converter={StaticResource A_Converter_League_ID_To_TierColor}}" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                    <local:FZMaterial Margin="6" Style="{StaticResource A_Style_FZMaterial_Empty_Inner_Tile}"/>
                                                </Grid>
                                            </local:FZMaterial>
                                        </StackPanel>

                                        <local:TickerItemsControl  HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,0,0,0"
                                                  ItemTemplate="{StaticResource A_ControlTemplate_RewardPreview}"
                                                  ItemsSource="{Binding Rewards}">
                                            <ItemsControl.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <StackPanel Orientation="Horizontal" IsItemsHost="True"/>
                                                </ItemsPanelTemplate>
                                            </ItemsControl.ItemsPanel>
                                        </local:TickerItemsControl>
                                    </Grid>
                                </Grid>
                            </local:FZMaterial>
                        </DockPanel>
                    </local:FZMaterial>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding HasAchievedLeagueRank}" Value="False">
                        <Setter Property="ImageSource" Value="{x:Null}" TargetName="BackingPanel"/>
                        <Setter Property="Style" Value="{StaticResource A_Style_FZMaterial_SeriesRewards_Tile}" TargetName="BackingPanel"/>
                        <Setter Property="Opacity" Value="0.3" TargetName="LeagueEmblem"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                        <Setter Property="FocusManager.FocusedElement" Value="{Binding RelativeSource={RelativeSource TemplatedParent}}" />
                    </DataTrigger>
                    
                    <DataTrigger Binding="{Binding IsKeyboardFocused, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                        <Setter Property="Visibility" Value="Visible" TargetName="DropShadow"/>
                        <Setter Property="Visibility" Value="Visible" TargetName="StrokeBackground"/>
                        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
                        <Setter Property="RenderTransform">
                            <Setter.Value>
                                <ScaleTransform ScaleX="1.04" ScaleY="1.04"/>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="local:ZPanel.DisableClipping" TargetName="LeagueRowContainer" Value="True"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <Style x:Key="A_Style_ItemContainerStyle_SeriesRewards" TargetType="ListBoxItem">
                <Setter Property="Focusable" Value="True" />
                <Setter Property="Margin" Value="0,0,0,6"/>
                <Setter Property="ClipToBounds" Value="False"/>
                <Setter Property="local:ZPanel.ZIndex" Value="0"/>
                <Style.Triggers>
                    <Trigger Property="IsKeyboardFocusWithin" Value="True">
                        <Setter Property="local:ZPanel.ZIndex" Value="20"/>
                    </Trigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_SeriesReward_EventCountDownControl" TargetType="{x:Type local:NetworkCountdownControl}" BasedOn="{StaticResource A_Style_EventCountdownControl}">
                <Setter Property="TimerDisplayName" Value="{Binding TimerText, Converter={StaticResource A_StringToUpper}}"/>
                <Setter Property="Visibility" Value="Visible"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SceneEnum}" Value="{x:Static local:SceneEntryEnum.SeriesRewardsClaims}">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_SeriesReward_Event_Expired_Count_Control" TargetType="Control" BasedOn="{StaticResource A_Style_Event_Timer}">
                <Setter Property="Visibility" Value="Collapsed"/>
                <Setter Property="Width" Value="420"/>
                <Setter Property="Height" Value="98"/>
                <Setter Property="local:BindingProxy.A" Value="{Binding TimerText, Converter={StaticResource A_StringToUpper}}" />
                <Setter Property="local:BindingProxy.B" Value="{Binding TimeSinceSeriesEnd, Converter={StaticResource A_StringToUpper}}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SceneEnum}" Value="{x:Static local:SceneEntryEnum.SeriesRewardsClaims}">
                        <Setter Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <local:MappingConverter x:Key="A_Converter_Reward_Visiblity_Converter" Default="Collapsed">
                <local:MappingConverterEntry Key="True" Value="Visible"/>
            </local:MappingConverter>
        </ResourceDictionary>
    </Page.Resources>

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Menu}"/>
    </local:UIPageTransitionManager.TransitionManager>
    <Grid>
        <!-- Background Blur -->
        <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />

        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <local:ControllerButtonPanel x:Name="HelpPanel" Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <local:ControllerButtonControl Button="A" Description="{local:Loc HelpButtons.IDS_ClaimRewards}"
                                               Visibility="{Binding RewardsReadyToView, FallbackValue=Collapsed, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                <local:ControllerButtonControl Button="B"
                                            Description="{local:Loc HelpButtons.IDS_Back}" />
            </local:ControllerButtonPanel>
        </ContentControl>

        <Grid x:Name="LayoutRoot" Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <local:MappingConverterResourcePreloader Converter="{StaticResource A_MappingConverter_League_To_Emblem_Large}" ValueType="BitmapImage" />
            
            <local:RoutedEventCommand x:Name="ItemListPageDown"
                                      RoutedEvent="UIElement.MouseLeftButtonUp"
                                      Command="{Binding ScrollPageNextCommand, ElementName=LeagueItemList}" />
            <local:RoutedEventCommand x:Name="ItemListPageUp"
                                      RoutedEvent="UIElement.MouseLeftButtonUp"
                                      Command="{Binding ScrollPagePrevCommand, ElementName=LeagueItemList}" />
            
            <Border ClipToBounds="false">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}"
                  ClipToBounds="false">
                    <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"
                                Visibility="{Binding RewardsReadyToView, FallbackValue=Visible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                        <ContentControl Content="{Binding SeriesTitle, Converter={StaticResource A_StringToUpper}}"
                                    HorizontalAlignment="Left"
                                    local:BindingProxy.A="ForzaUI;component/Textures/Anthem/Icons/Titles/SeriesReward.png"
                                    Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}" />
                        <DockPanel VerticalAlignment="Center" HorizontalAlignment="Center" Height="806">
                            
                            <!--Right hand column -->
                            <StackPanel Orientation="Vertical" DockPanel.Dock="Right" Width="380" Height="806">
                                <local:FZMaterial x:Name="HeaderPanel" Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPanel}" Height="72">
                                        <local:FZTextBlock Text="{Binding SeriesProgressText, Converter={StaticResource A_StringToUpper}}" MaxWidth="320" Margin="12"
                                                       VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" CapHeight="24" 
                                                       Color="{StaticResource A_Color_White}" FontFamily="Horizon_A" />
                                </local:FZMaterial>
                                <local:FZMaterial Height="320" Preset="{Binding BestRankData.HighestAchievedLeague,Converter={StaticResource A_Converter_League_ID_To_GradientPreset}}">
                                    <Grid>
                                        <local:FZMaterial ImageSource="{Binding BestRankData.HighestAchievedLeague,Converter={StaticResource A_Converter_League_ID_To_LeagueEmblemShadow}}"
                                                          Width="276" Height="275" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,45,0,0">
                                            <Control Style="{StaticResource A_Style_Control_HighestLeague_Emblem_Big}" DataContext="{Binding BestRankData}" 
                                                 VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-14,-20,0,0" />
                                        </local:FZMaterial>

                                        <local:FZMaterial x:Name="DarkPanel" VerticalAlignment="Bottom" Color="#60000000" MaxHeight="90">
                                            <StackPanel Orientation="Vertical" Margin="12,18">
                                                <local:FZTextBlock Text="{local:Loc RoadTrip.IDS_SeriesRewards_HighestLeagueThisSeries}" Color="{StaticResource A_Color_White}" 
                                                                   LineAdjust="-0.25"
                                                                   CapHeight="14" FontFamily="Horizon_D" TextAlignment="Center" TextWrapping="Wrap"/>
                                                <Decorator Height="10"/>
                                                <Decorator RenderTransform="{StaticResource A_Transform_Italic}">
                                                    <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding BestRankData.HighestAchievedLeague, FallbackValue=0, Converter={StaticResource A_Converter_League_ID_To_LeagueName}}" local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_" Color="{StaticResource A_Color_White}" CapHeight="16" FontFamily="Horizon_C" TextAlignment="Center"/>
                                                </Decorator>
                                            </StackPanel>
                                        </local:FZMaterial>
                                    </Grid>
                                </local:FZMaterial>

                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlassPanel_BodyPanel}">
                                    <DockPanel Height="328">
                                        <StackPanel DockPanel.Dock="Bottom">
                                            <local:FZMaterial Color="{StaticResource A_Color_White}" Height="1" Width="Auto"
                                                  VerticalAlignment="Center" Margin="16,6" Opacity="0.6" Preset="{StaticResource A_FZMaterialPresetRoundtangle_Line_OuterAll_Small}"/>
                                            <StackPanel Orientation="Horizontal" Margin="6" VerticalAlignment="Bottom">
                                                <local:FZMaterial Width="65" Height="65" Color="{StaticResource A_Color_White}" VerticalAlignment="Center" HorizontalAlignment="Left"
                                                                  ImageSource="/ForzaUI;component/Textures/Data_Bound/SeriesRewards/Prize_Icon_Large.png"/>
                                                <Decorator Width="10"/>
                                                <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0.5,4">
                                                    <local:FZTextBlock Text="{Binding Source={local:Loc RoadTrip.IDS_SeriesRewards_RewardsEarned}, Converter={StaticResource A_StringToUpper}}" 
                                                                       Style="{StaticResource A_Style_FZTextBlock_SeriesRewards_Base}" CapHeight="20"/>
                                                    <Decorator Height="8"/>
                                                    <local:FZTextBlock Text="{Binding EarnedRewardCount, FallbackValue=0}" 
                                                                       Style="{StaticResource A_Style_FZTextBlock_SeriesRewards_Base}" CapHeight="31.5"/>
                                                </StackPanel>
                                            </StackPanel>
                                        </StackPanel>
                                        <StackPanel Orientation="Vertical">
                                            <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{local:Loc RoadTrip.IDS_SeriesRewards_PlayAdventure_Description}" 
                                                               local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_" VerticalAlignment="Top"
                                                               TextWrapping="Wrap" Margin="16,24" CapHeight="14" FontFamily="Horizon_D"
                                                               Style="{StaticResource A_Style_FZTextBlock_SeriesRewards_Base}"/>
                                            <local:FZTextBlock Text="{local:Loc RoadTrip.IDS_SeriesRewards_EarnReward_Description}" VerticalAlignment="Bottom"
                                                               TextWrapping="Wrap" Margin="16,0,16,24" CapHeight="14" FontFamily="Horizon_D"
                                                               Style="{StaticResource A_Style_FZTextBlock_SeriesRewards_Base}"/>
                                        </StackPanel>
                                    </DockPanel>
                                </local:FZMaterial>

                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlassPanel_Pill}" Margin="0,6,0,0">
                                    <Grid>
                                        <Viewbox Width="280" Margin="6" HorizontalAlignment="Left">
                                            <local:NetworkCountdownControl Style="{StaticResource A_Style_SeriesReward_EventCountDownControl}"
                                                                           GenerateFormattedString="True" CountdownType="SeriesTimeRemaining" />
                                        </Viewbox>

                                        <Viewbox Width="280" Margin="6" HorizontalAlignment="Left">
                                            <Control Style="{StaticResource A_Style_SeriesReward_Event_Expired_Count_Control}"/>
                                        </Viewbox>
                                    </Grid>
                                </local:FZMaterial>
                            </StackPanel>

                            <StackPanel Margin="0,0,18,0">
                                <!--Left side Items list. -->
                                <ContentControl Style="{StaticResource A_Style_ContentControl_ScrollArrowBox}" Height="48"
                                        local:BindingProxy.A="{Binding Path=(local:FZScrollViewer.IsAtTop), ElementName=LeagueItemList}"
                                        local:RoutedEventCommand.Action="{Binding ElementName=ItemListPageUp}">
                                    <local:FZMaterial x:Name="ScrollUpArrow" 
                                          RenderTransformOrigin="0.5,0.5"
                                          Style="{StaticResource A_Style_FZMaterial_ScrollArrow_TextMenu}">
                                        <local:FZMaterial.RenderTransform>
                                            <RotateTransform Angle="180" />
                                        </local:FZMaterial.RenderTransform>
                                    </local:FZMaterial>
                                </ContentControl>
                                <Grid Height="702" Panel.ZIndex="2">
                                    <StackPanel Orientation="Vertical" Margin="0,6,0,0" VerticalAlignment="Top">
                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Empty_League_Row}"/>
                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Empty_League_Row}"/>
                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Empty_League_Row}"/>
                                    </StackPanel>
                                    <local:CommonListBox VerticalAlignment="Top" x:Name="LeagueItemList"
                                                     Margin="0,6,0,-6" HorizontalAlignment="Left"
                                                     ScrollViewer.VerticalScrollBarVisibility="Disabled" ClipToBounds="True"
                                                     SelectedItem="{Binding SelectedItem}"
                                                     ItemTemplate="{StaticResource A_DataTemplate_SeriesRewardLeagueItem}"
                                                     ItemContainerStyle="{StaticResource A_Style_ItemContainerStyle_SeriesRewards}"
                                                     ItemsSource="{Binding Collection}"
                                                     local:FocusOnPageFocusGained.VirtualizingSelectorSelectedItem="True" 
                                                     Style="{StaticResource A_Style_ListBox_TextMenu_Default}"/>
                                </Grid>
                                <local:FZMaterial x:Name="HitBlockerBottom" Height="7" Margin="-18,-18,-18,0" Color="#00000000" IsHitTestVisible="True"/>
                                <ContentControl Style="{StaticResource A_Style_ContentControl_ScrollArrowBox}" Margin="0,6,0,0" Height="48" VerticalAlignment="Bottom"
                                        local:BindingProxy.A="{Binding Path=(local:FZScrollViewer.IsAtBottom), ElementName=LeagueItemList}"
                                        local:RoutedEventCommand.Action="{Binding ElementName=ItemListPageDown}">
                                        <local:FZMaterial 
                                          VerticalAlignment="Center"
                                          Style="{StaticResource A_Style_FZMaterial_ScrollArrow_TextMenu}"/>
                                    </ContentControl>
                            </StackPanel>
                        </DockPanel>
                    </StackPanel>
                </Grid>
            </Border>
        </Grid>
    </Grid>
</Page>
