<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ForzaUI;assembly="
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <System:Double x:Key="A_Double_TombolaSpinnerHeight">635</System:Double>
    <System:Double x:Key="A_Double_TombolaSpinnerWidth">982</System:Double>
    <System:Double x:Key="A_Double_TicketWidth">862</System:Double>
    <System:Double x:Key="A_Double_TicketHeight">228</System:Double>
    <System:Double x:Key="A_Double_TicketHeightWithMargin">240</System:Double>
    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_ListHeight"
        Scale="{StaticResource A_Double_TicketHeightWithMargin}"/>
    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_AnimationValueScale"
                                    Scale="{StaticResource A_Double_TicketHeightWithMargin}"
                                    Add="-311.0" />

    <!-- These resources are referenced from the code-behind. Removing them WILL cause a crash. -->

    <!-- Tombola spin -->
    <PowerEase x:Key="PART_A_EasingFunction_TombolaWindUpEase" Power="2.5" EasingMode="EaseInOut"/>
    <PowerEase x:Key="PART_A_EasingFunction_TombolaLandingEase" Power="2.5"/>
    <ElasticEase x:Key="PART_A_EasingFunction_TombolaLockInEase" Oscillations="3" Springiness="2" EasingMode="EaseOut" />

    <KeyTime x:Key="PART_A_KeyTime_TombolaWindUpTime">0:0:0.66</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaLandingTime">0:0:5.5</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaLockInTime">0:0:6.07</KeyTime>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaLockInToCanSpinAgainDelay">0:0:1.0</System:TimeSpan>

    <OffsetKeyTime x:Key="PART_A_KeyTime_TombolaSpinAgainTime"
                   KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
                   Offset="{StaticResource A_TimeSpan_TombolaLockInToCanSpinAgainDelay}"/>

    <System:TimeSpan x:Key="PART_A_TimeSpan_TombolaSkipOffset">0:0:4.5</System:TimeSpan>
    
    <!-- Remaining Spins -->
    <ElasticEase x:Key="PART_A_EasingFunction_RemainingSpinsLandingInEase" Oscillations="1" Springiness="5" EasingMode="EaseOut" />
    <KeyTime x:Key="PART_A_KeyTime_RemainingSpinsLandTime">0:0:1.0</KeyTime>

    <!-- Logo Spin -->
    <PowerEase x:Key="PART_A_EasingFunction_TombolaLogoSpinEase_Startup" Power="2.5" EasingMode="EaseIn"/>
    <PowerEase x:Key="PART_A_EasingFunction_TombolaLogoSpinEase_LandSpin" Power="2.5"/>

    <KeyTime x:Key="PART_A_KeyTime_TombolaLogoSpin_StartTime">0:0:0.5</KeyTime>

    <!-- End of resources referenced from code-behind. -->

    <System:TimeSpan x:Key="A_TimeSpan_TombolaSkipDisabledOffset">-0:0:0.233</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaSkipEnabledOffset">0:0:0.0</System:TimeSpan>

    <System:TimeSpan x:Key="A_TimeSpan_TombolaPrizeVideoFadeOutStart">0:0:10.2</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaPrizeVideoFadeOutEnd">0:0:10.5</System:TimeSpan>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaSkipCompleteTime"
        KeyTime="0:0:0.0"
        Offset="{StaticResource PART_A_TimeSpan_TombolaSkipOffset}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaSkipDisabledTime"
        KeyTime="{StaticResource A_KeyTime_TombolaSkipCompleteTime}"
        Offset="{StaticResource A_TimeSpan_TombolaSkipDisabledOffset}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaSkipEnabledTime"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaWindUpTime}"
        Offset="{StaticResource A_TimeSpan_TombolaSkipEnabledOffset}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPlayWinAudio"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="0:0:0.0"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaLockInFlashFadeInStart"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaFlashOffsetFadeInStart}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaLockInFlashFadeInEnd"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaFlashOffsetFadeInEnd}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaLockInFlashFadeOutStart"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaFlashOffsetFadeOutStart}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaLockInFlashFadeOutEnd"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaFlashOffsetFadeOutEnd}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPrizeGlowFadeInStart"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaPrizeGlowFadeInStart}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPrizeGlowFadeInEnd"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaPrizeGlowFadeInEnd}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPrizeGlowFadeOutStart"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaPrizeGlowFadeOutStart}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPrizeGlowFadeOutEnd"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaPrizeGlowFadeOutEnd}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPrizeVideoFadeOutStart"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaPrizeVideoFadeOutStart}"/>

    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPrizeVideoFadeOutEnd"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLockInTime}"
        Offset="{StaticResource A_TimeSpan_TombolaPrizeVideoFadeOutEnd}"/>

    <Style x:Key="A_Style_FZTextBlock_CreditPrizeDetails_PrizeValue"
        BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
        TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Tombola_PrizeText}" />
        <Setter Property="CapHeight" Value="65" />
        <Setter Property="Text"
                Value="{Binding PrizeValue, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" />
        <Setter Property="Stretch"
                Value="None" />
        <Setter Property="Effect" Value="{StaticResource A_Effect_HighContrastModeDropShadow}" />
    </Style>

    <Style x:Key="A_FZRun_CarPrizeDetails_YEAR"
           TargetType="{x:Type local:FZRun}">
        <Setter Property="FontFamily"
                Value="Horizon_B" />
    </Style>

    <MappingConverter x:Key="A_MappingConverter_CarPrizeDetails" >
        <MappingConverterEntry Key="{NoCase YEAR}" Value="{StaticResource A_FZRun_CarPrizeDetails_YEAR}" />
    </MappingConverter>

    <Style x:Key="A_Style_FZTextBlock_CarPrizeDetails_CarManufacturer"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}"
           TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="Margin" Value="12,0,12,12" />
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="TextTrimming" Value="CharacterEllipsis" />
        <Setter Property="Color" Value="{StaticResource A_Color_Tombola_PrizeText}" />
        <Setter Property="CapHeight" Value="26" />
        <Setter Property="AutoScroll" Value="{StaticResource A_AutoScrollSettings_PrizeName}" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding DataSource.IsSpinComplete, RelativeSource={RelativeSource AncestorType=Page}}" Value="True"/>
                    <Condition Binding="{Binding IsWinningTicket}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="AutoScroll.AllowScrolling" Value="True"/>
                <Setter Property="TextTrimming" Value="None" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_CarPrizeDetails_CarModel"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
           TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="Margin" Value="12" />
        <Setter Property="Stretch" Value="None" />
        <Setter Property="TextTrimming" Value="CharacterEllipsis" />
        <Setter Property="Color" Value="{StaticResource A_Color_Tombola_PrizeText}" />
        <Setter Property="LineAdjust" Value="-0.5" />
        <Setter Property="CapHeight" Value="30" />
        <Setter Property="Effect" Value="{StaticResource A_Effect_HighContrastModeDropShadow}" />
        <Setter Property="AutoScroll" Value="{StaticResource A_AutoScrollSettings_PrizeName}" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding DataSource.IsSpinComplete, RelativeSource={RelativeSource AncestorType=Page}}" Value="True"/>
                    <Condition Binding="{Binding IsWinningTicket}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="AutoScroll.AllowScrolling" Value="True"/>
                <Setter Property="TextTrimming" Value="None" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_CarPrizeDetails_PrizeRarity"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
           TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="Margin" Value="0" />
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="TextWrapping" Value="NoWrap" />
        <Setter Property="Color" Value="{StaticResource A_Color_Tombola_PrizeText}" />
        <Setter Property="CapHeight" Value="32" />
        <Setter Property="AlignToCapAndBaseLines" Value="True" />
        <Setter Property="Effect" Value="{StaticResource A_Effect_HighContrastModeDropShadow}" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_CarPrizeDetails_PrizeName"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
           TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="Margin" Value="0" />
        <Setter Property="Stretch" Value="None" />
        <Setter Property="TextTrimming" Value="CharacterEllipsis" />
        <Setter Property="Color" Value="{StaticResource A_Color_Tombola_PrizeText}" />
        <Setter Property="CapHeight" Value="30" />
        <Setter Property="AlignToCapAndBaseLines" Value="True" />
        <Setter Property="Effect" Value="{StaticResource A_Effect_HighContrastModeDropShadow}" />
        <Setter Property="AutoScroll" Value="{StaticResource A_AutoScrollSettings_PrizeName}" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding DataSource.IsSpinComplete, RelativeSource={RelativeSource AncestorType=Page}}" Value="True"/>
                    <Condition Binding="{Binding IsWinningTicket}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="AutoScroll.AllowScrolling" Value="True"/>
                <Setter Property="TextTrimming" Value="None" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_TombolaDrumBackground"
           TargetType="local:FZMaterial">
        <Setter Property="ImageSource"
                Value="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Prize_Backround.png" />
        <Setter Property="Stretch"
                Value="Uniform" />
        <Setter Property="Height"
                Value="610" />
        <Setter Property="Width"
                Value="956" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_TombolaDrumForeground"
           TargetType="local:FZMaterial">
        <Setter Property="ImageSource"
                Value="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Drum_Foreground.png" />
        <Setter Property="Stretch"
                Value="Uniform" />
        <Setter Property="Height"
                Value="610" />
        <Setter Property="Width"
                Value="956" />
    </Style>

    <ControlTemplate x:Key="A_Template_Tombola_FlashGlow" TargetType="ContentControl">
        <Grid x:Name="FlashGlow"
              Opacity="0">
            <ContentPresenter/>
        </Grid>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding AnimationState}" Value="{x:Static TombolaAnimationStates.Spinning}">
                <DataTrigger.EnterActions>
                    <local:BeginUIStoryboard x:Name="BeginStoryboard_TombolaPanel">
                        <local:UIStoryboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FlashGlow"
                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                        Value="0.0" />
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaPrizeGlowFadeInStart}"
                                                        Value="0.0" />
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaPrizeGlowFadeInEnd}"
                                                      Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}" />
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaPrizeGlowFadeOutStart}"
                                                        Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}" />
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaPrizeGlowFadeOutEnd}"
                                                      Value="0.0" />
                            </DoubleAnimationUsingKeyFrames>
                        </local:UIStoryboard>
                    </local:BeginUIStoryboard>
                </DataTrigger.EnterActions>
            </DataTrigger>
            <DataTrigger Binding="{Binding IsSkipComplete}" Value="True">
                <DataTrigger.EnterActions>
                    <SeekStoryboard BeginStoryboardName="BeginStoryboard_TombolaPanel"
                                    Offset="{StaticResource PART_A_TimeSpan_TombolaSkipOffset}"
                                    Origin="{x:Static TimeSeekOrigin.BeginTime}"/>
                </DataTrigger.EnterActions>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <DataTemplate DataType="{x:Type local:TombolaTicketCredits}" >
        <Decorator Height="{StaticResource A_Double_TicketHeightWithMargin}">
            <local:FZMaterial Width="{StaticResource A_Double_TicketWidth}"
                    Height="{StaticResource A_Double_TicketHeight}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Preset="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaPrizeBackgroundGradientPreset}}">
                <local:FZMaterial x:Name="Backing" ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Prize_Backing_Credits.png">
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center">
                        <Control Style="{StaticResource H_Style_Control_CreditsIcon}"/>
                        <Decorator Width="10"/>
                        <Decorator HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Style="{StaticResource A_Style_Decorator_TombolaCreditsSkewTransform}">
                            <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CreditPrizeDetails_PrizeValue}"
                                        VerticalAlignment="Center" />
                        </Decorator>
                    </StackPanel>
                </local:FZMaterial>
            </local:FZMaterial>
        </Decorator>
    </DataTemplate>

    <GridLength x:Key="A_GridLength_TombolaTicket_PrizeTop">65</GridLength>
    <GridLength x:Key="A_GridLength_TombolaTicket_PrizeBottom">15</GridLength>

    <DataTemplate DataType="{x:Type local:TombolaTicketCar}">
        <Decorator Height="{StaticResource A_Double_TicketHeightWithMargin}">
            <local:FZMaterial Width="{StaticResource A_Double_TicketWidth}"
                    Height="{StaticResource A_Double_TicketHeight}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Preset="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaPrizeBackgroundGradientPreset}}">
                <local:FZMaterial x:Name="Backing" ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Prize_Backing_Car.png">
                    <Grid>
                        <local:FZMaterial Width="431"
                            Height="242"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            ImageSource="{Binding ForegroundImage}"
                            Margin="16,-24,16,24" 
                            Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={FZBooleanToVisibilityConverter}}"/>
                        <Grid Margin="16,28,16,16" Width="375" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeTop}"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeBottom}"/>
                            </Grid.RowDefinitions>
                            <Decorator Grid.Row="0"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Bottom"
                                MaxWidth="375">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarModel}"
                                    Text="{Binding CarModel, Converter={StaticResource A_StringToUpper}}"
                                    MarkupConverter="{StaticResource A_MappingConverter_CarPrizeDetails}" />
                            </Decorator>
                            <local:FZTextBlock Grid.Row="1"
                                Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarManufacturer}"
                                HorizontalAlignment="Center"
                                Text="{Binding CarManufacturer, Converter={StaticResource A_StringToUpper}}" />
                            <Control Grid.Row="2"
                                     Style="{StaticResource A_Style_Control_TombolaHorizonEditionBlammo}"
                                     Margin="7"
                                     VerticalAlignment="Center"
                                     HorizontalAlignment="Center"/>
                        </Grid>
                    </Grid>
                </local:FZMaterial>
            </local:FZMaterial>
        </Decorator>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding PrizeRarity}" Value="{x:Static local:XAMLRarity.HorizonEdition}">
                <Setter TargetName="Backing" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Prize_Backing_Car_HorizonEdition.png" />
            </DataTrigger> 
        </DataTemplate.Triggers>
    </DataTemplate>
    
    <MappingConverter x:Key="A_LangStrToPrizeNameSeparator" Default="10">
        <MappingConverterEntry Key="CHS" Value="18"/>
        <MappingConverterEntry Key="CHT" Value="18"/>
    </MappingConverter>

    <DataTemplate DataType="{x:Type local:TombolaTicketEmote}">
        <Decorator Height="{StaticResource A_Double_TicketHeightWithMargin}">
            <local:FZMaterial Width="{StaticResource A_Double_TicketWidth}"
                    Height="{StaticResource A_Double_TicketHeight}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Preset="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaPrizeBackgroundGradientPreset}}">
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Prize_Backing_Emotes.png">
                    <Grid>
                        <Decortator ClipToBounds="True" Margin="7">
                            <local:FZMaterial Width="452"
                                Height="452"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                ImageSource="{Binding ForegroundImage}"
                                Margin="-125,125,16,16"
                                Opacity="0.25"/>
                        </Decortator>
                        <local:FZMaterial Width="226"
                            Height="226"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            ImageSource="{Binding ForegroundImage}"
                            Margin="170,16,16,16"/>
                        <Grid Margin="16,27,74,16" Width="375" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeTop}"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeBottom}"/>
                            </Grid.RowDefinitions>
                            <StackPanel Grid.Row="0"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                MaxWidth="375"
                                Margin="12">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_PrizeName}"
                                    Text="{Binding PrizeName, Converter={StaticResource A_StringToUpper}}"/>
                            </StackPanel>
                          <local:FZTextBlock Grid.Row="1"
                              Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarManufacturer}"
                              FontFamily="Horizon_B"
                              HorizontalAlignment="Center"
                              Text="{local:Loc Rivals.IDS_RewardType_Emote}" />
                        </Grid>
                    </Grid>
                </local:FZMaterial>
            </local:FZMaterial>
        </Decorator>
    </DataTemplate>


    <DataTemplate DataType="{x:Type local:TombolaTicketHorn}">
        <Decorator Height="{StaticResource A_Double_TicketHeightWithMargin}">
            <local:FZMaterial Width="{StaticResource A_Double_TicketWidth}"
                    Height="{StaticResource A_Double_TicketHeight}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Preset="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaPrizeBackgroundGradientPreset}}">
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Prize_Backing_Horn.png">
                    <Grid>
                        <Grid HorizontalAlignment="Left"
                              VerticalAlignment="Center"
                              Margin="65,0,0,0">
                            <Control Template="{StaticResource A_Template_HornPrize_Image}"
                                     Height="170"
                                     Width="170"/>
                        </Grid>
                        <Grid Margin="16,27,74,16" Width="375" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeTop}"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeBottom}"/>
                            </Grid.RowDefinitions>
                            <StackPanel Grid.Row="0"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Bottom"
                                MaxWidth="375"
                                Margin="12">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_PrizeName}"
                                    Text="{Binding PrizeName, Converter={StaticResource A_StringToUpper}}"/>
                            </StackPanel>
                          <local:FZTextBlock Grid.Row="1"
                              Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarManufacturer}"
                              HorizontalAlignment="Center"
                              Text="{local:Loc Rivals.IDS_RewardType_Horn}" />
                        </Grid>
                    </Grid>
                </local:FZMaterial>
            </local:FZMaterial>
        </Decorator>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:TombolaTicketClothing}">
        <Decorator Height="{StaticResource A_Double_TicketHeightWithMargin}">
            <local:FZMaterial Width="{StaticResource A_Double_TicketWidth}"
                    Height="{StaticResource A_Double_TicketHeight}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Preset="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaPrizeBackgroundGradientPreset}}">
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Prize_Backing_Clothing.png">
                    <Grid>
                        <local:FZMaterial Width="226"
                            Height="226"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            ImageSource="{Binding ForegroundImage}"
                            Margin="70,16,0,16"/>
                        <Grid Margin="16,27,74,16" Width="375" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeTop}"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="{StaticResource A_GridLength_TombolaTicket_PrizeBottom}"/>
                            </Grid.RowDefinitions>
                            <StackPanel Grid.Row="0"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                MaxWidth="375"
                                Margin="12">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_PrizeName}"
                                    Text="{Binding PrizeName, Converter={StaticResource A_StringToUpper}}"/>
                            </StackPanel>
                          <local:FZTextBlock Grid.Row="1"
                              Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarManufacturer}"
                              HorizontalAlignment="Center"
                              Text="{local:Loc Rivals.IDS_RewardType_Clothing}" />
                        </Grid>
                    </Grid>
                </local:FZMaterial>
            </local:FZMaterial>
        </Decorator>
    </DataTemplate>

    <Style x:Key="A_Style_TicketsList"
        TargetType="ItemsControl"
        BasedOn="{StaticResource A_Style_TicketsList_Base}">
        <Setter Property="Height" Value="{Binding Count, Converter={StaticResource A_LinearTransformConverter_ListHeight}}"/>
    </Style>

    <Style x:Key="A_Style_FrameworkElement_SpinnerContainer"
        TargetType="{x:Type FrameworkElement}">
        <Setter Property="Width" Value="{StaticResource A_Double_TicketWidth}"/>
    </Style>

    <Thickness x:Key="A_Thickness_TicketToPrizeBoxOuterBorder">12</Thickness>
    <Thickness x:Key="A_Thickness_TicketToPrizeBoxInnerBorder">21</Thickness>

    <ControlTemplate x:Key="A_Template_TombolaPrizeBorder" TargetType="ContentControl">
        <Grid>
            <local:FZMaterial Margin="{StaticResource A_Thickness_TicketToPrizeBoxInnerBorder}"
                              Preset="{StaticResource A_FZMaterialPresetRoundtangle_TombolaGlassInnerBorder}"
                              Color="#80FFFFFF"/>
            <local:FZMaterial Margin="{StaticResource A_Thickness_TicketToPrizeBoxOuterBorder}"
                              Preset="{StaticResource A_FZMaterialPresetRoundtangle_TombolaOuterBorder}"
                              Color="{StaticResource H_Color_Primary_White}"/>
            <ContentPresenter/>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_TombolaBorder" TargetType="Control">
        <Grid Style="{StaticResource A_Style_FrameworkElement_SpinnerContainer}"
                VerticalAlignment="Center"
                HorizontalAlignment="Center"
                Width="{StaticResource A_Double_TombolaSpinnerWidth}"
                Height="{StaticResource A_Double_TombolaSpinnerHeight}">

            <ContentControl Template="{StaticResource A_Template_TombolaPrizeBorder}"
                            Margin="2,1">
                <Grid>
                    <Grid X:Name="Arrows"
                        VerticalAlignment="Center">
                        <FZMaterial Style="{StaticResource A_Style_FZMaterial_Arrow_Left}"/>
                        <FZMaterial Style="{StaticResource A_Style_FZMaterial_Arrow_Right}"/>
                    </Grid>
                    <ContentControl Template="{StaticResource A_Template_Tombola_FlashGlow}">
                        <Grid Margin="{StaticResource A_Thickness_TicketToPrizeBoxOuterBorder}"
                              DataContext="{Binding WinningTickets[0]}">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_WinningPrizeSoftGlow}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_WinningPrizeHardGlow}"/>
                            <FZMaterial Style="{StaticResource A_Style_FZMaterial_WinningPrizeHardGlow_Arrows_Tombola}"
                                        Margin="5,0,0,0"
                                        Tag="Left"/>
                            <FZMaterial Style="{StaticResource A_Style_FZMaterial_WinningPrizeHardGlow_Arrows_Tombola}"
                                        Margin="0,0,5,0"
                                        Tag="Right"/>
                        </Grid>
                    </ContentControl>
                </Grid>
            </ContentControl>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_TombolaPanelContents">
        <Grid>
            <!-- Spinner Block -->
            <Decorator x:Name="SpinnerBlock"
                Style="{StaticResource A_Style_FrameworkElement_SpinnerContainer}">
                <Grid ClipToBounds="True" Style="{StaticResource A_Style_Grid_MotionBlur}" Margin="0,-20"
                      local:MotionBlurEffect.MotionBlurPositionYControl="{Binding (Control.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y), ElementName=TicketList}">
                    <ItemsControl DataContext="{Binding TicketLists[0]}"
                        Style="{StaticResource A_Style_TicketsList}"
                        x:Name="TicketList">
                        <ItemsControl.RenderTransform>
                            <TransformGroup>
                                <TranslateTransform Y="{Binding TicketListsTranslateY0, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_LinearTransformConverter_AnimationValueScale}}" />
                            </TransformGroup>
                        </ItemsControl.RenderTransform>
                    </ItemsControl>
                </Grid>
            </Decorator>

            <local:FZMaterialGlassCapture/>
        </Grid>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding AnimationState}" Value="{x:Static local:TombolaAnimationStates.Skipping}">
                <DataTrigger.EnterActions>
                    <local:BeginUIStoryboard>
                        <local:UIStoryboard>
                            <local:UIStoryboard.TriggerAnimation>
                                <local:StartAudioTrigger EventName="AudioUITrigger_WheelSpin_Skip"
                                    local:TriggerAnimation.KeyTime="0:0:0.0"/>
                                <local:RaiseFzEvent EventName="SkipComplete"
                                    local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TombolaResetTime}"/>
                            </local:UIStoryboard.TriggerAnimation>
                        </local:UIStoryboard>
                    </local:BeginUIStoryboard>
                </DataTrigger.EnterActions>
            </DataTrigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="A_Style_Control_TombolaPanelContents"
        TargetType="{x:Type Control}">
        <Setter Property="Width" Value="920"/>
        <Setter Property="Height" Value="575"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="ClipToBounds" Value="True"/>
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_TombolaPanelContents}"/>
    </Style>

</ResourceDictionary>
