<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:devonly="http://schemas.playground-games.com/xaml/devonly"
      devonly:DevOnly="devonly"
      x:Class="ForzaUI.A_CampaignCollectionCategory"
      x:Name="Page"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={x:Static RelativeSource.Self}}">
    <Page.Resources>
        <AutoScrollSettings x:Key="H_AutoScrollSettings_Debug" 
            ScrollSeparation="50"
            ScrollOrientation="Horizontal"
            Speed="100"
            InitialPause="0:0:0.75"/>

        <ControlTemplate x:Key="H_Template_DebugTexturePath">
            <FZTextBlock CapHeight="20" Text="{TemplateBinding Tag}"
                Stretch="None"
                Color="Magenta"
                AutoScroll="{StaticResource H_AutoScrollSettings_Debug}"/>
        </ControlTemplate>

        <MultiConverter x:Key="H_Converter_Flip01">
            <MultiConverterEntry Converter="{Clamp Min=0, Max=1}"/>
            <MultiConverterEntry Converter="{LinearTransformConverter Scale=-1, Add=1 }"/>
        </MultiConverter>

        <DataTemplate x:Key="H_Template_CollectionCampaignItem">
            <Grid local:ManualPassthroughProperty.Input="{Binding Name}"
                  local:ManualPassthroughProperty.Allowed="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
                  local:ScreenReader.Line="{Binding (local:ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                  local:ScreenReader.LineType="SelectedItem"
                  local:ScreenReader.Event="OnChange"
                  local:ScreenReader.ControlType="Button"
                  local:ScreenReader.SelectedNumber="{Binding (VirtualizingWrapPanel.ItemIndex), FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}}"
                  local:ScreenReader.SelectedCount="{Binding Items.Count, FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type Selector}}}">
                <DockPanel Margin="17">
                    <Grid DockPanel.Dock="Bottom"
                        Height="40">
                        <FZMaterial Color="{StaticResource H_Color_Primary_Black}"/>
                        <DockPanel Margin="4,4,0,4">
                            <Grid DockPanel.Dock="Right" Width="43">
                                <Control Height="30" Style="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource H_Converter_CampaignToCurrencyControlStyle}}" />
                            </Grid>
                            <Grid x:Name="prog"
                                MultiDataConversion.Value="{Binding Progress, FallbackValue=0}"
                                MultiDataConversion.TargetType="Double"
                                MultiDataConversion.Parameter="{Binding Total, FallbackValue=1}"
                                MultiDataConversion.Converter="{MathOperationConverter Operation=Divide}"
                                local:ManualPassthroughProperty.Allowed="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
                                local:ScreenReader.Line="{Binding (local:ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                                local:ScreenReader.LineType="ItemState"
                                local:ScreenReader.Event="OnChange">
                                <FZMaterial x:Name="prog_unfinished" Color="#4d4d4d" RenderTransformOrigin="1,0">
                                    <FZMaterial.RenderTransform>
                                        <ScaleTransform ScaleX="{Binding (MultiDataConversion.Output), ElementName=prog, Converter={StaticResource H_Converter_Flip01}, FallbackValue=0}" />
                                    </FZMaterial.RenderTransform>
                                </FZMaterial>
                                <FZMaterial x:Name="prog_backing" Color="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource H_Converter_CampaignToProgressBarColour}}">
                                    <FZMaterial.RenderTransform>
                                        <ScaleTransform ScaleX="{Binding (MultiDataConversion.Output), ElementName=prog, Converter={Clamp Min=0, Max=1}}" />
                                    </FZMaterial.RenderTransform>
                                </FZMaterial>

                                <FZTextBlock TextAlignment="Center"
                                    x:Name="prog_text"
                                    VerticalAlignment="Center"
                                    FontFamily="Horizon_C" Color="{StaticResource H_Color_Primary_White}" CapHeight="16" >
                                    <FZRun x:Name="prog_value" Text="{Binding Progress, Converter={NumUnitConverter FractionDigits=0}}"/>
                                    <FZRun x:Name="prog_slash" Text=" / "/>
                                    <FZRun x:Name="prog_total" Text="{Binding Total, Converter={NumUnitConverter FractionDigits=0}}"/>
                                </FZTextBlock>
                            </Grid>
                        </DockPanel>
                    </Grid>
                    <Decorator Height="25" DockPanel.Dock="Bottom"/>
                    <FZTextBlock DockPanel.Dock="Bottom"
                                 Text="{Binding Name}"
                                 Color="{StaticResource H_Color_Primary_Black}"
                                 FontFamily="Horizon_A"
                                TextAlignment="Center"
                                 CapHeight="21" />
                    <Grid/>
                </DockPanel>

                <Grid Margin="0" VerticalAlignment="Center">
                    <FZMaterial ImageSource="{Binding IconPath}"
                        x:Name="icon_texture"
                        GreedyMeasure="True"
                        Stretch="Uniform"

                        devonly:ReportDownloadFailed="True"/>
                    <devonly:Control x:Name="debug_fail" Tag="{Binding DownloadFailedPath, ElementName=icon_texture}" Template="{Binding Tag, RelativeSource={RelativeSource Self}, Converter={CompareConverter Value={x:Null}, NotEqual={StaticResource H_Template_DebugTexturePath}}}" />
                </Grid>

                <ContentControl Style="{StaticResource H_Style_NotificationBadge_NarrationPassthrough}"
                    Visibility="{Binding Pending, Converter={CompareConverter Value=0, GreaterThan=Visible, LessThanOrEqual=Collapsed}}"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Top"
                    Height="34"
                    Margin="11,9"
                    ContentTemplate="{x:Null}"
                    local:MultiStringFormatter.Format="{local:Loc Campaign.IDS_ScreenReader_CampaignCollection_UnclaimedRewardsBreadcrumb}"
                    local:MultiStringFormatter.Param0="{Binding Pending}"
                    local:ManualPassthroughProperty.Input="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"
                    local:ScreenReader.Line="{Binding (local:ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                    local:ScreenReader.LineType="SelectedDetails"
                    local:ScreenReader.Event="OnChange">
                    <StackPanel Orientation="Horizontal">
                        <FZMaterial Margin="2,0,0,0" Stretch="Uniform" GreedyMeasure="True" ImageSource="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\Reward_Icon.png" Color="{StaticResource H_Color_Primary_Black}"/>
                        <FZTextBlock Margin="-2,0,3,-2" VerticalAlignment="Center" CapHeight="18" FontFamily="Horizon_C" Color="{StaticResource H_Color_Primary_Black}" Text="&#x00d7;"/>
                        <FZTextBlock Margin="0,0,10,0" VerticalAlignment="Center" CapHeight="18" FontFamily="Horizon_C" Color="{StaticResource H_Color_Primary_Black}" Text="{Binding Pending}"/>
                    </StackPanel>
                </ContentControl>
                <FZMaterial Preset="{Roundtangle CornerRadius=8}" Color="#c000" Visibility="{Binding Locked, Converter={FZBooleanToVisibilityConverter}}">
                    <FZTextBlock CapHeight="50" Text="locked" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </FZMaterial>
            </Grid>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Complete}" Value="True">
                    <Setter TargetName="prog_value" Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
                    <Setter TargetName="prog_slash" Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
                    <Setter TargetName="prog_total" Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
                    <Setter TargetName="prog_text" Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
                    <Setter TargetName="prog_backing" Property="Color" Value="#fff"/>
                    <Setter TargetName="prog_backing" Property="ImageSource" Value="game:\media\UI\Textures\Data_Bound\CollectionCampaign\Gold_value_Background.png"/>
                    <Setter TargetName="icon_texture" Property="ImageSource" Value="{Binding CompletedIconPath}"/>
                    <Setter TargetName="prog" Property="local:ManualPassthroughProperty.Input" Value="{Loc Campaign.IDS_ScreenReader_Campaign_ItemState_Completed}"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Locked}" Value="True">
                    <Setter TargetName="prog" Property="local:ManualPassthroughProperty.Input" Value="{Loc Campaign.IDS_ScreenReader_Undiscovered}"/>
                </DataTrigger>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Complete}" Value="False" />
                        <Condition Binding="{Binding Locked}" Value="False" />
                    </MultiDataTrigger.Conditions>
                    <Setter TargetName="prog" Property="local:MultiStringFormatter.Format" Value="{Binding CampaignId, RelativeSource={RelativeSource AncestorType={x:Type Page}}, Converter={StaticResource H_Converter_CampaignToScreenReadableProgressFormat}}"/>
                    <Setter TargetName="prog" Property="local:MultiStringFormatter.Param0" Value="{Binding Progress}"/>
                    <Setter TargetName="prog" Property="local:MultiStringFormatter.Param1" Value="{Binding Total}"/>
                    <Setter TargetName="prog" Property="local:ManualPassthroughProperty.Input" Value="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"/>
                </MultiDataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <Double x:Key="H_ItemWidth">324</Double>
        <Double x:Key="H_ItemHeight">370</Double>
        <Double x:Key="H_ItemGap">6</Double>

        <Double x:Key="H_ItemsH">5</Double>
        <Double x:Key="H_ItemsV">2</Double>


        <Thickness x:Key="H_Thickness_ItemMarginScale">0.5,0.5,0.5,0.5</Thickness>
        <Style x:Key="H_ContainerStyle_CollectionCategory"
            BasedOn="{StaticResource H_Style_ContentControl_Carousel_ContainerStyle}"
            TargetType="{x:Type ListBoxItem}">
            <Style.Resources>
                <Thickness x:Key="A_StrokeHighlight_InnerThickness">6</Thickness>
                <Thickness x:Key="A_StrokeHighlight_OuterThickness">6</Thickness>
            </Style.Resources>
            <Setter Property="Margin" Value="{Convert {StaticResource H_ItemGap}, Converter={MathOperationConverter Operation=Multiply}, Parameter={StaticResource H_Thickness_ItemMarginScale}, TargetType={x:Type Thickness}}"/>
        </Style>

<!--
        <MappingConverter x:Key="H_RewardIdToTexture" Default="">
            <MappingConverterEntry Key="{Identifier64 brio_horizon_rush_8001}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\showcase.png" />
            <MappingConverterEntry Key="{Identifier64 brio_horizon_rush_8002}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\showcase.png" />
            <MappingConverterEntry Key="{Identifier64 brio_horizon_rush_8003}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\showcase.png" />
            <MappingConverterEntry Key="{Identifier64 brio_festival_invitational_event}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\showcase.png" />
            <MappingConverterEntry Key="{Identifier64 brio_horizon_legend_event}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\showcase.png" />

            <MappingConverterEntry Key="{Identifier64 player_house_one}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\House_Icon_01.png" />
            <MappingConverterEntry Key="{Identifier64 player_house_estate}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\House_Icon_02.png" />
            <MappingConverterEntry Key="{Identifier64 player_house_FishingVillage}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\House_Icon_03.png" />
            <MappingConverterEntry Key="{Identifier64 player_house_AlpineLodge}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\House_Icon_04.png" />
            <MappingConverterEntry Key="{Identifier64 player_house_Unkai}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\House_Icon_05.png" />
            <MappingConverterEntry Key="{Identifier64 player_house_Warehouse}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\House_Icon_06.png" />
            <MappingConverterEntry Key="{Identifier64 player_house_Futurist}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\House_Icon_07.png" />

            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_PointsOfInterestFound}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\POIs.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_HiddenCarsFound}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\HiddenCars.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_StoryStarsEarned}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\Stories.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_JobsCompleted}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\Jobs.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_BuildingsPurchased}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\Buildings.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_CollectiblesSmashed}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\Collectibles.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_RacesCompleted}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\Races.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_PRStuntStarsEarned}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\PRStunts.png" />
            <MappingConverterEntry Key="{Identifier64 MapRegionContentGroup_WristbandEventsCompleted}"
                Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\UnlockIcons\WristbandEvents.png" />
        </MappingConverter>
-->        

        <MappingConverter x:Key="H_MilestoneIdToTexture" Default="">
            <MappingConverterEntry Key="{StaticResource H_Key_Band1}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\HF_Banner_01.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Band2}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\HF_Banner_02.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Band3}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\HF_Banner_03.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Band4}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\HF_Banner_04.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Band5}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\HF_Banner_05.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Band6}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\HF_Banner_06.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Band7}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\HF_Banner_07.png"/>

            <MappingConverterEntry Key="{StaticResource H_Key_StampNone}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_00.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Stamp1}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_01.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Stamp2}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_02.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Stamp3}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_03.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Stamp4}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_04.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Stamp5}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_05.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Stamp6}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_06.png"/>
            <MappingConverterEntry Key="{StaticResource H_Key_Stamp7}" 
                Value="game:\media\ui\textures\Data_Bound\CollectionCampaign\DJ_Banner_07.png"/>
        </MappingConverter>


        <Style x:Key="H_ContainerStyle_CollectionCategory_Empty"
            TargetType="{x:Type Control}">
            <Setter Property="Margin" Value="{Convert {StaticResource H_ItemGap}, Converter={MathOperationConverter Operation=Multiply}, Parameter={StaticResource H_Thickness_ItemMarginScale}, TargetType={x:Type Thickness}}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Control">
                        <FZMaterial Color="{StaticResource H_Color_Glass_Purple_20pc}" Preset="{GlassRoundtangle CornerRadius=8, BlurAmount=High}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <MappingConverter x:Key="H_MarkupConverter_WristbandReward">
            <MappingConverterEntry Key="{NoCase sub}">
                <MappingConverterEntry.Value>
                    <Style TargetType="FZRun">
                        <Setter Property="FontFamily"
                                Value="Horizon_D" />/>
                    </Style>
                </MappingConverterEntry.Value>
            </MappingConverterEntry>
        </MappingConverter>

        <Style x:Key="H_Style_WristbandRewardsBox">
            <Setter Property="Height" Value="92"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}}" Value="{StaticResource H_Id_DiscoverCampaign}">
                    <Setter Property="Margin" Value="0,0,94,0"/>
                    <Setter Property="Width" Value="390"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}}" Value="{StaticResource H_Id_FestivalCampaign}">
                    <Setter Property="Margin" Value="0,0,114,0"/>
                    <Setter Property="Width" Value="485"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="H_Style_WristbandTick" TargetType="FZMaterial">
            <Setter Property="GetSizeFromTexture" Value="True"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}}" Value="{StaticResource H_Id_DiscoverCampaign}">
                    <Setter Property="Margin" Value="219,0,0,0"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}}" Value="{StaticResource H_Id_FestivalCampaign}">
                    <Setter Property="Margin" Value="116,0,0,0"/>
                </DataTrigger>

                <DataTrigger Binding="{Binding Complete}" Value="True">
                    <Setter Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\Wristband_Tick.png"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Future}" Value="True">
                    <Setter Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\Wristband_Lock.png"/>
                    <Setter Property="Preset" Value="{StaticResource A_FZMaterialPreset_AlphaOnly}"/>
                    <Setter Property="Color" Value="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource H_Converter_CampaignToBodyColour}}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>


        <ControlTemplate x:Key="H_Template_Wristband">
            <Grid>
                <FZMaterial />
                <FZMaterial x:Name="image" GetSizeFromTexture="True" HorizontalAlignment="Right" VerticalAlignment="Bottom" ImageSource="{Binding Id, Converter={StaticResource H_MilestoneIdToTexture}}" />
                <FZTextBlock Color="{StaticResource H_Color_Primary_Black}"
                    CapHeight="37"
                    Margin="30,34,0,0"
                    FontFamily="Horizon_C"
                    Text="{Binding Id, Converter={StaticResource H_Converter_ObjectiveToName}}" />
                <FZTextBlock Color="{StaticResource H_Color_Primary_Black}"
                    CapHeight="14"
                    VerticalAlignment="Bottom"
                    Margin="30,0,0,21"
                    FontFamily="Horizon_C"
                    TrackingAdjust="0.3"
                    Text="{Binding Id, Converter={StaticResource H_Converter_ObjectiveToUpperSubtitle}}" />
                <DockPanel VerticalAlignment="Bottom"
                            HorizontalAlignment="Right"
                            Visibility="Collapsed"
                            Height="122"
                            Width="544"
                            x:Name="blocked_info">
                    <FZMaterial Stretch="None"
                                GreedyMeasure="True"
                                Stretch="Uniform"
                                x:Name="blocked_icon"
                                DockPanel.Dock="Left"
                                ImageSource="{Binding Id, Converter={StaticResource H_MilestoneIdToBlockedIcon}}" />
                    <DockPanel>
                        <Grid x:Name="blocked_button" Visibility="Collapsed" HorizontalAlignment="Left" DockPanel.Dock="Bottom" Height="45" Margin="0,-5,0,5" Panel.ZIndex="10">
                            <DockPanel HorizontalAlignment="Center">
                                <Grid Margin="0,-50">
                                    <FZMaterialGlassCapture/>
                                    <ControllerButtonControl HideBackground="True" Visibility="Visible" Button="Back" DockPanel.Dock="Left"
                                        Command="{Binding MapCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                </Grid>
                                <Decorator Width="10" DockPanel.Dock="Left" />
                                <FZTextBlock TextAlignment="Center"
                                             VerticalAlignment="Center"
                                             CapHeight="15"
                                             Color="{StaticResource H_Color_Primary_White}"
                                             FontFamily="Horizon_B"
                                             Text="{Loc Campaign.IDS_Journal_ViewMilestone_Prompt}" />
                            </DockPanel>
                        </Grid>
                        <FZTextBlock FontFamily="Horizon_D"
                                     TextWrapping="Wrap"
                                     LineAdjust="-0.5"
                                     VerticalAlignment="Center"
                                     CapHeight="14"
                                     Margin="0,0,5,0"
                                     Stretch="None"
                                     x:Name="blocked_text"
                                     Color="{StaticResource H_Color_Primary_White}"
                                     MarkupConverter="{StaticResource H_MarkupConverter_BlockedDesc}"/>
                    </DockPanel>
                </DockPanel>
                <!--FZMaterial Style="{StaticResource H_Style_WristbandTick}" />
                <Grid Style="{StaticResource H_Style_WristbandRewardsBox}" HorizontalAlignment="Right">
                    <DockPanel>
                        <ItemsControl ItemsSource="{Binding Rewards}"
                                      DockPanel.Dock="Right"
                                      Margin="0,0,20,0"
                                      HorizontalAlignment="Right">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal"
                                                IsItemsHost="True" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemContainerStyle>
                                <Style>
                                    <Setter Property="DockPanel.Dock"
                                            Value="Right" />
                                </Style>
                            </ItemsControl.ItemContainerStyle>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Grid Width="60"
                                          Height="60">
                                        <FZMaterial ImageSource="{Binding IconId, Converter={StaticResource H_RewardIdToTexture}}" />
                                        <ContentControl Style="{StaticResource H_Style_NotificationBadge}"
                                                        Visibility="Visible"
                                                        HorizontalAlignment="Right"
                                                        VerticalAlignment="Bottom"
                                                        Height="24"
                                                        Margin="0,0,-10,-10"
                                                        ContentTemplate="{x:Null}">
                                            <FZTextBlock HorizontalAlignment="Center"
                                                         VerticalAlignment="Center"
                                                         CapHeight="11"
                                                         FontFamily="Horizon_A"
                                                         Color="{StaticResource H_Color_Primary_Black}">
                                                <FZRun Text="{Binding Description}" />
                                            </FZTextBlock>
                                        </ContentControl>
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <DockPanel>
                            <Grid Width="70"
                                  Height="70"
                                  DockPanel.Dock="Left"
                                  Margin="12">
                                <FZMaterial GetSizeFromTexture="True"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Center"
                                            ImageSource="{Binding MainReward.IconId, Converter={StaticResource H_RewardIdToTexture}}" />
                            </Grid>
                            <FZTextBlock Margin="0,0,12,0" 
                                         DockPanel.Dock="Right"
                                         Text="+"
                                         FontFamily="Horizon_C"
                                         CapHeight="30"
                                         Color="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource H_Converter_CampaignToBodyColour}}"
                                         VerticalAlignment="Center"
                                         Visibility="{Binding Rewards.Count, Converter={CompareConverter Value=0, 
                                            GreaterThan={x:Static Visibility.Visible},
                                            LessThanOrEqual={x:Static Visibility.Collapsed} }}"/>
                            <FZTextBlock LineAdjust="-0.75"
                                         TextWrapping="Wrap"
                                         Stretch="None"
                                         VerticalAlignment="Center"
                                         CapHeight="15"
                                         FontFamily="Horizon_C"
                                         Color="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource H_Converter_CampaignToBodyColour}}"
                                         Text="{Binding MainReward.Description}"
                                         MarkupConverter="{StaticResource H_MarkupConverter_WristbandReward}" />
                        </DockPanel>
                    </DockPanel>

                </Grid-->
            </Grid>
            <ControlTemplate.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Index}" Value="-1"/>
                        <Condition Binding="{Binding CampaignId, RelativeSource={RelativeSource AncestorType=Page}}" Value="{StaticResource H_Id_FestivalCampaign}"/>
                    </MultiDataTrigger.Conditions>
                    <Setter TargetName="blocked_info" Property="Visibility" Value="Visible"/>
                    <Setter TargetName="image" Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\Objective_Pattern.png"/>
                    <Setter TargetName="blocked_icon" Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\objective_icon.png"/>
                    <Setter TargetName="blocked_icon" Property="Margin" Value="35"/>
                    <Setter TargetName="blocked_text" Property="Text" Value="{Loc Campaign.IDS_Qualifiers_Desc}"/>
                </MultiDataTrigger>
                <DataTrigger Binding="{Binding Blocked}" Value="True">
                    <Setter TargetName="blocked_info" Property="Visibility" Value="Visible"/>
                    <Setter TargetName="image" Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\CollectionCampaign\Objective_Pattern.png"/>
                    <Setter TargetName="blocked_icon" Property="Margin" Value="0"/>
                    <Setter TargetName="blocked_icon" Property="ImageSource" Value="{Binding Id, Converter={StaticResource H_MilestoneIdToBlockedIcon}}"/>
                    <Setter TargetName="blocked_text" Property="Text" Value="{Binding Id, Converter={StaticResource H_MilestoneIdToBlockedText}}"/>
                </DataTrigger> 
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Blocked}" Value="True"/>
                        <Condition Binding="{Binding MapCommand, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="True"/>
                    </MultiDataTrigger.Conditions>
                    <Setter TargetName="blocked_button" Property="Visibility" Value="{Binding IsInPlayerHouse, FallbackValue=Collapsed, Source={StaticResource PART_UISceneContext}, Converter={FZBooleanToVisibilityConverter InvertResult=True}}"/>
                </MultiDataTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="H_Style_MapCommand"
            TargetType="{x:Type PageInputHandler}">
            <Setter Property="Command" Value="{Binding MapCommand}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsInPlayerHouse, FallbackValue=False, Source={StaticResource PART_UISceneContext}}" Value="True">
                    <Setter Property="Command" Value="{x:Null}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

    </Page.Resources>
    <UIPageTransitionManager.TransitionManager>
        <UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Menu}" />
    </UIPageTransitionManager.TransitionManager>
    <Grid>

        <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />
        <FZMaterialGlassCapture/>
        <PageInputHandler x:Name="a_button"
                          Button="A"
                          Command="{Binding SelectCommand}" />
        <PageInputHandler x:Name="b_button"
                          Button="B"
                          Command="{Binding BackCommand}" />
        <PageInputHandler x:Name="redeem_button"
                          Button="X"
                          Command="{Binding RedeemCommand}" />
        <PageInputHandler x:Name="sort_button"
                          Button="Y"
                          Command="{Binding SortCommand}" />
        <PageInputHandler x:Name="map_button"
                          Button="Back"
                          Style="{StaticResource H_Style_MapCommand}" />
        <ContentControl x:Name="BottomBar"
                        Panel.ZIndex="10"
                        Style="{StaticResource A_Style_ButtonBar}">
            <ControllerButtonPanel x:Name="PART_HelpPanel"
                                   Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <ControllerButtonControl Button="{Binding Button, ElementName=a_button}"
                                         Description="{Loc HelpButtons.IDS_Select}"
                                         Visibility="{Binding Command.Enabled, FallbackValue=Collapsed, Converter={FZBooleanToVisibilityConverter}, ElementName=a_button}" />
                <ControllerButtonControl Button="{Binding Button, ElementName=b_button}"
                                         Description="{Loc HelpButtons.IDS_Back}"
                                         Visibility="{Binding Command.Enabled, FallbackValue=Collapsed, Converter={FZBooleanToVisibilityConverter}, ElementName=b_button}" />
                <ControllerButtonControl Button="{Binding Button, ElementName=redeem_button}"
                                         Description="{Binding Command.Name, ElementName=redeem_button}"
                                         Visibility="{Binding Command.Enabled, FallbackValue=Collapsed, Converter={FZBooleanToVisibilityConverter}, ElementName=redeem_button}" />
                <ControllerButtonControl Button="{Binding Button, ElementName=sort_button}"
                                         Description="{Binding Command.Name, ElementName=sort_button}"
                                         Visibility="{Binding Command.Enabled, FallbackValue=Collapsed, Converter={FZBooleanToVisibilityConverter}, ElementName=sort_button}" />
                <!--ControllerButtonControl
                    Button="{Binding Button, ElementName=lb_button}"
                    Description="xPrev milestone"
                    Visibility="{Binding Command, FallbackValue=Collapsed, Converter={CompareConverter Value={x:Null}, Equal={x:Static Visibility.Collapsed}, NotEqual={x:Static Visibility.Visible}}, ElementName=lb_button}" />
                <ControllerButtonControl
                    Button="{Binding Button, ElementName=rb_button}"
                    Description="xNext milestone"
                    Visibility="{Binding Command, FallbackValue=Collapsed, Converter={CompareConverter Value={x:Null}, Equal={x:Static Visibility.Collapsed}, NotEqual={x:Static Visibility.Visible}}, ElementName=rb_button}" /-->
            </ControllerButtonPanel>
        </ContentControl>
        <Border Style="{StaticResource A_Style_Border_ScenePadding_Opus}"
                SnapsToDevicePixels="True"
                UseLayoutRounding="True" x:Name="root">
            <StackPanel Orientation="Vertical"
                        Margin="0,0,0,50"
                        Style="{StaticResource A_Style_FrameworkElement_DefaultTransition}"
                           UIPageTransitionManager.TransitionIndex="0"
                           HorizontalAlignment="Center"
                        VerticalAlignment="Center">
                <Grid VerticalAlignment="Top"
                        local:ScreenReader.Line="{Binding CampaignId, Converter={StaticResource H_Converter_CampaignToScreenReadableName}}"
                        local:ScreenReader.LineType="ScreenTitle"
                        local:ScreenReader.Event="OnLoad">
                    <Grid HorizontalAlignment="Left" VerticalAlignment="Bottom">
                        <Grid Margin="-22,0,0,0"
                            local:ScreenReader.Line="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                            local:ScreenReader.LineType="ScreenDescription"
                            local:ScreenReader.Event="OnLoad">
                            <Grid.Style>
                                <Style TargetType="{x:Type Grid}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding SelectedMilestone.Blocked}" Value="True">
                                            <Setter Property="local:MultiStringFormatter.Format" Value="{local:Loc Campaign.IDS_MilestoneReached}"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding SelectedMilestone.Blocked}" Value="False">
                                            <Setter Property="local:MultiStringFormatter.Format" Value="{Binding CampaignId, Converter={StaticResource H_Converter_CampaignToScreenReadableProgressToMilestoneFormat}}"/>
                                            <Setter Property="local:MultiStringFormatter.Param0" Value="{Binding SelectedMilestone.Progress}"/>
                                            <Setter Property="local:MultiStringFormatter.Param1" Value="{Binding SelectedMilestone.Total}"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <FZMaterial GetSizeFromTexture="True" VerticalAlignment="Bottom" ImageSource="{Binding CampaignId, Converter={StaticResource H_Converter_CampaignToTitleBlock}}"
                                            x:Name="Screen_Title" />
                            <ProgressBar DataContext="{Binding SelectedMilestone}" Template="{StaticResource H_Template_Milestone}" Maximum="{Binding Total, Converter={LinearTransformConverter}}" Value="{Binding Progress, Converter={LinearTransformConverter}}"
                                Margin="0,0,0,10"
                                Width="410" HorizontalAlignment="Center" VerticalAlignment="Bottom">
                                <DynamicData.Data>
                                    <DynamicDataItem Name="Thickness" Value="30" DataType="Double" />
                                    <DynamicDataItem Name="CapHeight" Value="15" DataType="Double" />
                                </DynamicData.Data>
                            </ProgressBar>
                        </Grid>
                    </Grid>
                    <StackPanel x:Name="milestones" HorizontalAlignment="Right" VerticalAlignment="Bottom">
                        <Grid HorizontalAlignment="Left" Margin="12,0,0,0"
                                Panel.ZIndex="10">
                            <ItemsSelector
                                x:Name="tab_bar"
                                PageSize="1"
                                Margin="0,0,0,-14"
                                ItemsSource="{Binding Milestones}"
                                ItemContainerStyle="{StaticResource H_Style_MilestonePip}"
                                SelectedItem="{Binding SelectedMilestone, Mode=TwoWay}">
                                <ItemsSelector.Template>
                                    <ControlTemplate>
                                        <UniformGrid Rows="1" Width="658" IsItemsHost="True"/>
                                    </ControlTemplate>
                                </ItemsSelector.Template>
                            </ItemsSelector>
                        </Grid>

                        <Grid Width="{StaticResource H_Milestone_Slide_Offset}"
                              Height="122">
                            <Control DataContext="{Binding SelectedMilestone, NotifyOnTargetUpdated=True}"
                                Template="{StaticResource H_Template_Wristband}"/>
                        </Grid>

                    </StackPanel>
                </Grid>
                <Decorator Height="14" />
                <StackPanel Orientation="Horizontal">
                    <Decorator x:Name="menu_wrapper" Margin="10">
                        <Decorator Margin="-10">
                            <WrapListBox x:Name="menu"
                                         ItemsSource="{Binding ItemsView}"
                                         ScrollOrientation="Vertical"
                                         PageSize="10"
                                         Width="{Convert {StaticResource H_ItemWidth}, Converter={LinearTransformConverter Scale={StaticResource H_ItemsH}, Add={Convert {StaticResource H_ItemGap}, Converter={LinearTransformConverter Scale={StaticResource H_ItemsH}}}}}"
                                         Height="{Convert {StaticResource H_ItemHeight}, Converter={LinearTransformConverter Scale={StaticResource H_ItemsV}, Add={Convert {StaticResource H_ItemGap}, Converter={LinearTransformConverter Scale={StaticResource H_ItemsV}}}}}"
                                         HorizontalAlignment="Center"
                                         Template="{StaticResource A_ControlTemplate_Carousel_Default}"
                                         ItemContainerStyle="{StaticResource H_ContainerStyle_CollectionCategory}"
                                         EmptyItemStyle="{StaticResource H_ContainerStyle_CollectionCategory_Empty}"
                                         ItemTemplate="{StaticResource H_Template_CollectionCampaignItem}"
                                         ItemWidth="{Convert {StaticResource H_ItemWidth}, Converter={LinearTransformConverter Add={StaticResource H_ItemGap}}}"
                                         ItemHeight="{Convert {StaticResource H_ItemHeight}, Converter={LinearTransformConverter Add={StaticResource H_ItemGap}}}"
                                         SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                         FocusOnPageFocusGained.SelectorSelectedItem="True"
                                         Margin="{Margin 
                                            Left={Convert {StaticResource H_ItemGap}, Converter={LinearTransformConverter Scale=-0.5}}, 
                                            Top={Convert {StaticResource H_ItemGap}, Converter={LinearTransformConverter Scale=-0.5}},
                                            Right={Convert {StaticResource H_ItemGap}, Converter={LinearTransformConverter Scale=-0.5}},
                                            Bottom={Convert {StaticResource H_ItemGap}, Converter={LinearTransformConverter Scale=-0.5}}
                                            }">
                                <WrapListBox.Resources>
                                    <Thickness x:Key="H_Dynamic_CarouselInnerClip">12</Thickness>
                                    <Thickness x:Key="H_Dynamic_CarouselOuterClip">16</Thickness>
                                </WrapListBox.Resources>
                            </WrapListBox>
                        </Decorator>
                    </Decorator>
                    <ScrollBar Style="{StaticResource A_Style_ScrollBar_Default}"
                               Margin="10,0,0,0"
                               Panel.ZIndex="0"
                               Minimum="{Binding ScrollWindowMin, ElementName=menu}"
                               Maximum="{Binding ScrollWindowMax, ElementName=menu}"
                               Value="{Binding ScrollWindowValue, ElementName=menu, Mode=TwoWay}"
                               ViewportSize="{Binding ScrollWindowSize, ElementName=menu}" />
                </StackPanel>
            </StackPanel>
        </Border>

        <Control Template="{StaticResource H_Template_RewardWidget}" />
    </Grid>
</Page>
