<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">

    <local:UIStoryboard x:Key="A_Storyboard_TombolaInfiniteFlash" RepeatBehavior="Forever">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
            <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                Value="0"
                EasingFunction="{local:LinearEasing}" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                Value="1"
                EasingFunction="{local:LinearEasing}" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.2"
                Value="0"
                EasingFunction="{local:LinearEasing}" />
        </DoubleAnimationUsingKeyFrames>
    </local:UIStoryboard>

    <local:UIStoryboard x:Key="A_Storyboard_TombolaInfiniteFlash_Inverted" RepeatBehavior="Forever">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
            <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                Value="1"
                EasingFunction="{local:LinearEasing}" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                Value="0"
                EasingFunction="{local:LinearEasing}" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.2"
                Value="1"
                EasingFunction="{local:LinearEasing}" />
        </DoubleAnimationUsingKeyFrames>
    </local:UIStoryboard>

    <Double x:Key="A_Double_Background_Height">855</Double>

    <System:Double x:Key="A_Double_TombolaPrizeGlowFlashOpacity">0.75</System:Double>

    <MultiConverter x:Key="A_NumUnitConverter_NoUnit_0dp_WithCreditUnit">
        <MultiConverterEntry Converter="{StaticResource A_NumUnitConverter_NoUnit_0dp}" TargetType="{Type String}"/>
        <MultiConverterEntry Converter="{StaticResource A_Converter_StringFormatConverter}" Parameter="{Loc UnitStrings.IDS_Units_Credits_Format}" TargetType="{Type String}"/>
    </MultiConverter>

    <AutoScrollSettings x:Key="A_AutoScrollSettings_PrizeName"
                        ScrollSeparation="100"
                        InitialPause="0:0:0.5"
                        Speed="40"
                        ScrollOrientation="Horizontal"
                        ApplyClip="True"/>

    <Style x:Key="A_Style_Decorator_TombolaCreditsSkewTransform" TargetType="FrameworkElement">
        <Setter Property="RenderTransformOrigin"
                Value="0.5,0.5" />
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TransformGroup>
                    <SkewTransform AngleX="-7" />
                </TransformGroup>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_TombolaScene_Border" TargetType="Control">
        <Grid>
            <FZMaterial ImageSourceNoPreload="/ForzaUI;component/Textures/Anthem/Tombola/Wheelspin_Border.png"
                        Height="1080"
                        Width="1920"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="A_Style_FZMaterial_Geometry_Arrow" TargetType="FZMaterial">
        <Setter Property="Width" Value="29"/>
        <Setter Property="Height" Value="19"/>
        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5" />
        <Setter Property="Data">
            <Setter.Value>
                <local:FZGeometry Data="M0.5,1,1,0,0,0z" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZMaterial_Arrow_Right" TargetType="FZMaterial"
        BasedOn="{StaticResource A_Style_FZMaterial_Geometry_Arrow}">
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="Margin" Value="0,0,17,0"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <RotateTransform Angle="90" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZMaterial_Arrow_Left" TargetType="FZMaterial"
        BasedOn="{StaticResource A_Style_FZMaterial_Geometry_Arrow}">
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="Margin" Value="17,0,0,0"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <RotateTransform Angle="-90" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZMaterial_WinningPrizeHardGlow_Arrows_Tombola"
        TargetType="{x:Type local:FZMaterial}"
        BasedOn="{StaticResource A_Style_FZMaterial_Geometry_Arrow}">
        <Setter Property="Color" Value="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToColor}}"/>
        <Style.Triggers>
            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_TombolaInfiniteFlash}"/>
            </EventTrigger>
            <Trigger Property="Tag" Value="Right">
                <Setter Property="HorizontalAlignment" Value="Right"/>
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <RotateTransform Angle="90" />
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Tag" Value="Left">
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <RotateTransform Angle="-90" />
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <local:LinearTransformConverter x:Key="A_TombolaLitBulbAngleRoundingConverter"
        Scale="360"
        Round="18" /> <!-- Round=360deg / bulb count -->
    <local:LinearTransformConverter x:Key="A_TombolaBulbAngleOffsetConverter" Scale="-18"/> <!-- Scale=360deg / bulb count -->
    <local:LinearTransformConverter x:Key="A_TombolaNegHalfConverter" Scale="-0.5"/>

    <MappingConverter x:Key="A_TombolaBulbIndexToOpacityConverter" Default="0">
        <MappingConverterEntry Key="0" Value="0.4"/>
        <MappingConverterEntry Key="1" Value="0.8"/>
        <MappingConverterEntry Key="2" Value="1.0"/>
        <MappingConverterEntry Key="3" Value="0.8"/>
        <MappingConverterEntry Key="4" Value="0.6"/>
        <MappingConverterEntry Key="5" Value="0.4"/>
        <MappingConverterEntry Key="6" Value="0.2"/>
    </MappingConverter>

    <local:LinearTransformConverter x:Key="A_TombolaBackgroundSpokeAngleOffsetConverter" Scale="18"/> <!-- Scale=360deg / Spoke Count -->

    <Style x:Key="A_Style_FZMaterial_TombolaBackgroundSpoke"
        TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Width" Value="498"/>
        <Setter Property="Height" Value="2400"/>
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetAdditive}"/>
        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Color" Value="#26FFFFFF"/>
        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Starburst_Single.png"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TransformGroup>
                    <TranslateTransform Y="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type local:FZMaterial}}, Converter={StaticResource A_TombolaNegHalfConverter}}"/>
                    <RotateTransform Angle="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type local:FZMaterial}}, Converter={StaticResource A_TombolaBackgroundSpokeAngleOffsetConverter}}"/>
                </TransformGroup>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_ItemsControl_TombolaBackgroundSpokes"
        TargetType="{x:Type ItemsControl}">
        <Setter Property="AlternationCount" Value="10000"/>
        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ItemsControl}">
                    <Grid IsItemsHost="True"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <RotateTransform/>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                <local:BeginUIStoryboard>
                    <local:UIStoryboard RepeatBehavior="Forever">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                    Value="0" />
                            <LinearDoubleKeyFrame KeyTime="0:0:45.0"
                                                    Value="-360" />
                        </DoubleAnimationUsingKeyFrames>
                    </local:UIStoryboard>
                </local:BeginUIStoryboard>
            </EventTrigger>
        </Style.Triggers>
    </Style>

    <local:MappingConverter x:Key="A_VisibleForHighRarityOnly" Default="{x:Static Visibility.Hidden}">
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Common}" Value="{x:Static Visibility.Hidden}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Rare}" Value="{x:Static Visibility.Hidden}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Epic}" Value="{x:Static Visibility.Hidden}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Legendary}" Value="{x:Static Visibility.Visible}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.HorizonEdition}" Value="{x:Static Visibility.Visible}"/>
    </local:MappingConverter>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Default"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            GradientColorA="{StaticResource A_Color_TombolaBackgroundGradientA_Default}"
            GradientColorB="{StaticResource A_Color_TombolaBackgroundGradientB_Default}"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Common"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            GradientColorA="{StaticResource A_Color_TombolaBackgroundGradientA_Common}"
            GradientColorB="{StaticResource A_Color_TombolaBackgroundGradientB_Common}"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Rare"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            GradientColorA="{StaticResource A_Color_TombolaBackgroundGradientA_Rare}"
            GradientColorB="{StaticResource A_Color_TombolaBackgroundGradientB_Rare}"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Epic"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            GradientColorA="{StaticResource A_Color_TombolaBackgroundGradientA_Epic}"
            GradientColorB="{StaticResource A_Color_TombolaBackgroundGradientB_Epic}"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Legendary"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            GradientColorA="{StaticResource A_Color_TombolaBackgroundGradientA_Legendary}"
            GradientColorB="{StaticResource A_Color_TombolaBackgroundGradientB_Legendary}"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_HorizonEdition"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            GradientColorA="{StaticResource A_Color_TombolaBackgroundGradientA_HorizonEdition}"
            GradientColorB="{StaticResource A_Color_TombolaBackgroundGradientB_HorizonEdition}"/>

    <local:MappingConverter x:Key="A_Converter_RarityToTombolaBackgroundGradientPreset" Default="{StaticResource A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Default}">
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Common}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Common}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Rare}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Rare}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Epic}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Epic}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Legendary}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Legendary}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.HorizonEdition}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_HorizonEdition}"/>
    </local:MappingConverter>

    <Style x:Key="A_Style_FZMaterial_TombolaBackgroundGradient"
        TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaBackgroundGradient_Default}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsSpinComplete}" Value="True">
                <Setter Property="Preset" Value="{Binding MostRareWinningTicket.PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaBackgroundGradientPreset}}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaPrizeBackground_Base"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            CornerRadius="8"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Default"
            BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackground_Base}"
            GradientColorA="{StaticResource A_Color_TombolaPrizeBackgroundGradientA_Default}"
            GradientColorB="{StaticResource A_Color_TombolaPrizeBackgroundGradientB_Default}"
            GradientAngle="90"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Common"
            BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackground_Base}"
            GradientColorA="{StaticResource A_Color_TombolaPrizeBackgroundGradientA_Common}"
            GradientColorB="{StaticResource A_Color_TombolaPrizeBackgroundGradientB_Common}"
            GradientAngle="90"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Rare"
            BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackground_Base}"
            GradientColorA="{StaticResource A_Color_TombolaPrizeBackgroundGradientA_Rare}"
            GradientColorB="{StaticResource A_Color_TombolaPrizeBackgroundGradientB_Rare}"
            GradientAngle="90"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Epic"
            BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackground_Base}"
            GradientColorA="{StaticResource A_Color_TombolaPrizeBackgroundGradientA_Epic}"
            GradientColorB="{StaticResource A_Color_TombolaPrizeBackgroundGradientB_Epic}"
            GradientAngle="90"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Legendary"
            BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackground_Base}"
            GradientColorA="{StaticResource A_Color_TombolaPrizeBackgroundGradientA_Legendary}"
            GradientColorB="{StaticResource A_Color_TombolaPrizeBackgroundGradientB_Legendary}"
            GradientAngle="90"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_HorizonEdition"
            BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackground_Base}"
            GradientColorA="{StaticResource A_Color_TombolaPrizeBackgroundGradientA_HorizonEdition}"
            GradientColorB="{StaticResource A_Color_TombolaPrizeBackgroundGradientB_HorizonEdition}"
            GradientAngle="90"/>

    <local:MappingConverter x:Key="A_Converter_RarityToTombolaPrizeBackgroundGradientPreset" Default="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Default}">
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Common}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Common}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Rare}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Rare}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Epic}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Epic}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.Legendary}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_Legendary}"/>
        <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.HorizonEdition}" Value="{StaticResource A_FZMaterialPresetRoundtangle_TombolaPrizeBackgroundGradient_HorizonEdition}"/>
    </local:MappingConverter>

    <ColorAlias x:Key="A_Color_Tombola_PrizeText"
                Color="{StaticResource H_Color_Primary_Black}"/>
    
    <Style x:Key="A_Style_ItemsControl_SpinsRemaining"
        TargetType="ItemsControl">
    </Style>

    <DataTemplate x:Key="A_DataTemplate_TextMenu_CounterNumber">
        <Grid IsHitTestVisible="False" 
              Width="178"
              Height="{Binding RemainingSpinsItemHeight, RelativeSource={RelativeSource AncestorType=Page}}"
              Margin="0,0,0,0"
              HorizontalAlignment="Center">
            <FZTextBlock x:Name="MainText"
                         Text="{Binding SpinValue}"
                         CapHeight="32"
                         TextAlignment="Center"
                         FontFamily="Horizon_C"
                         Style="{StaticResource A_Style_FZTextBlock_OptionText}"/>
        </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding SpinValue}" Value="-1">
                <Setter TargetName="MainText" Property="Visibility" Value="Hidden"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_TombolaCounter" TargetType="ContentControl">
        <Grid Width="178"
              Height="137">
            <FZMaterial x:Name="CounterBackground"
                        ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Counter_BottomLayer.png"
                        Width="178"
                        Height="137"/>
            <Grid ClipToBounds="True">
                <ItemsControl x:Name="SpinsCounter"
                            Height="137"
                            Margin="0,0,0,10"
                            Style="{StaticResource A_Style_ItemsControl_SpinsRemaining}"
                            ItemsSource="{Binding SpinsRemainingCounter}"
                            ItemTemplate="{StaticResource A_DataTemplate_TextMenu_CounterNumber}"
                            HorizontalAlignment="Center">
                    <ItemsControl.RenderTransform>
                        <TransformGroup>
                            <TranslateTransform Y="{Binding RemainingSpinsTranslateY, RelativeSource={RelativeSource AncestorType=Page}}" />
                        </TransformGroup>
                    </ItemsControl.RenderTransform>
                </ItemsControl>
            </Grid>
            <FZMaterial x:Name="CounterBackgroundStroke"
                        ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Counter_TopLayer.png"
                        Width="178"
                        Height="137"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="A_Style_FZTextBlock_TombolaSpinsRemaining" TargetType="FZTextBlock"
        BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
        <Setter Property="Text" Value="{Loc PauseMenu.IDS_Tombola_SpinsRemaining_Plural}"/>
        <Setter Property="CapHeight" Value="20"/>
        <Setter Property="TextAlignment" Value="Center"/>
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Margin" Value="0,10,0,0"/>
        <Setter Property="LineAdjust" Value="-0.7"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Text}" Value="1">
                <Setter Property="Text" Value="{local:Loc PauseMenu.IDS_Tombola_SpinsRemaining_Singular}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

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

    <MappingConverter x:Key="A_MappingConverter_Tombola_Bold" >
        <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_FZRun_Tombola_BOLD}" />
    </MappingConverter>

    <Style x:Key="A_Style_FZTextBlock_TombolaHorizonEditionText" TargetType="{x:Type local:FZTextBlock}"
        BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
        <Setter Property="CapHeight" Value="15"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
        <Setter Property="Margin" Value="21,0"/>
        <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
        <Setter Property="Stretch" Value="None"/>
        <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_TombolaHorizonEditionBacking"
        TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Height" Value="28"/>
        <Setter Property="Preset" Value="{Roundtangle CornerRadius={StaticResource H_CornerRadius_All_2px}}"/>
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
        <Setter Property="Visibility" Value="{Binding HorizonEditionBonus, Converter={StaticResource A_StringVisConverter}}"/>
    </Style>

    <Style x:Key="A_Style_Control_TombolaHorizonEditionBlammo"
        TargetType="{x:Type Control}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Control}">
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TombolaHorizonEditionBacking}"
                                      MaxWidth="375">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TombolaHorizonEditionText}"
                            Text="{Binding HorizonEditionBonus, Converter={StaticResource A_StringToUpper}}" 
                            MarkupConverter="{StaticResource A_MappingConverter_Tombola_Bold}"/>
                    </local:FZMaterial>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_Control_SuperTombolaHorizonEditionBlammo"
        TargetType="{x:Type Control}"
        BasedOn="{StaticResource A_Style_Control_TombolaHorizonEditionBlammo}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Control}">
                    <FZMaterial Style="{StaticResource A_Style_FZMaterial_TombolaHorizonEditionBacking}"
                        MaxWidth="346">
                        <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TombolaHorizonEditionText}"
                            Text="{Binding HorizonEditionBonus, Converter={StaticResource A_StringToUpper}}"
                            MarkupConverter="{StaticResource A_MappingConverter_Tombola_Bold}"/>
                    </FZMaterial>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="A_Template_HornPrize_Image" TargetType="Control">
        <ControlTemplate.Resources>
            <CornerRadius x:Key="A_CornerRadius_Divider">2,2,2,2</CornerRadius>
        </ControlTemplate.Resources>
        <Grid>
            <FZMaterial Color="{StaticResource H_Color_Primary_Black}"
                        Width="{TemplateBinding Width}"
                        Height="{TemplateBinding Height}"
                        Stretch="Uniform">
                <FZMaterial.Preset>
                    <FZMaterialPresetRoundtangle 
                        CornerRadius="{Binding ActualWidth, Converter={MathOperationConverter Operation=Divide}, 
                                        ConverterParameter={StaticResource A_CornerRadius_Divider}, 
                                        RelativeSource={RelativeSource AncestorType=FZMaterial}}"/>
                </FZMaterial.Preset>
            </FZMaterial>
            <FZMaterial Width="{TemplateBinding Width}"
                        Height="{TemplateBinding Height}"
                        Stretch="Uniform"
                        ImageSource="/ForzaUI;component/Textures/Data_Bound/Reward/Horn.png"/>
        </Grid>
    </ControlTemplate>

    <KeyTime x:Key="A_KeyTime_TombolaResetTime">0:0:0.3495</KeyTime>

    <System:TimeSpan x:Key="A_TimeSpan_TombolaFlashOffsetFadeInStart">-0:0:0.3</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaFlashOffsetFadeInEnd">-0:0:0.0495</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaFlashOffsetFadeOutStart">0:0:0.0495</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaFlashOffsetFadeOutEnd">0:0:0.3495</System:TimeSpan>

    <System:TimeSpan x:Key="A_TimeSpan_TombolaPrizeGlowFadeInStart">-0:0:0.3</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaPrizeGlowFadeInEnd">0:0:0.0</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaPrizeGlowFadeOutStart">0:0:3.5</System:TimeSpan>
    <System:TimeSpan x:Key="A_TimeSpan_TombolaPrizeGlowFadeOutEnd">0:0:3.8</System:TimeSpan>

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

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

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

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

    <Style x:Key="A_Style_FZMaterial_TombolaFlash"
        TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetAdditive}"/>
        <Setter Property="Color" Value="#FFFFFFFF"/>
        <Setter Property="Opacity" Value="0"/>
    </Style>

    <Style x:Key="A_Style_TicketsList_Base"
        TargetType="ItemsControl">
        <Setter Property="Margin" Value="0,20"/>
        <Setter Property="ItemsSource" Value="{Binding}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel Orientation="Vertical" IsItemsHost="True"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangle_TombolaOuterBorder"
        CornerRadius="16"
        Thickness="10"/>

    <local:FZMaterialPresetGlassRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangle_TombolaGlassInnerBorder"
        CornerRadius="8"
        Thickness="8"
        BlurAmount="High"/>

    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangle_TombolaHardGlow"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaOuterBorder}"
        CornerRadius="16"
        Thickness="10"/>

    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangle_TombolaSoftGlow"
        CornerRadius="16"
        Thickness="15"
        Softness="96"
        AlphaMode="Additive"/>

    <MappingConverter x:Key="A_Converter_RarityToTombolaHardGlowPreset" Default="{StaticResource A_FZMaterialPresetRoundtangle_TombolaHardGlow}">
        <MappingConverterEntry Key="{x:Static XAMLRarity.HorizonEdition}">
            <MappingConverterEntry.Value>
                <local:FZMaterialPresetRoundtangleStroke
                    BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaHardGlow}"
                    GradientColorA="{StaticResource A_Color_HorizonEditionGradientA}"
                    GradientColorB="{StaticResource A_Color_HorizonEditionGradientB}"
                    GradientAngle="90"/>
            </MappingConverterEntry.Value>
        </MappingConverterEntry>
    </MappingConverter>

    <MappingConverter x:Key="A_Converter_RarityToTombolaSoftGlowPreset" Default="{StaticResource A_FZMaterialPresetRoundtangle_TombolaSoftGlow}">
        <MappingConverterEntry Key="{x:Static XAMLRarity.HorizonEdition}">
            <MappingConverterEntry.Value>
                <local:FZMaterialPresetRoundtangleStroke
                    BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_TombolaSoftGlow}"
                    GradientColorA="{StaticResource A_Color_HorizonEditionGradientA}"
                    GradientColorB="{StaticResource A_Color_HorizonEditionGradientB}"
                    GradientAngle="90"/>
            </MappingConverterEntry.Value>
        </MappingConverterEntry>
    </MappingConverter>

    <Style x:Key="A_Style_FZMaterial_WinningPrizeHardGlow"
        TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Opacity" Value="0"/>
        <Setter Property="Color" Value="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToColor}}"/>
        <Setter Property="Preset" Value="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaHardGlowPreset}}"/>
        <Style.Triggers>
            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_TombolaInfiniteFlash}"/>
            </EventTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_WinningPrizeSoftGlow"
        TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Opacity" Value="0"/>
        <Setter Property="Margin" Value="-40"/>
        <Setter Property="Color" Value="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToColor}}"/>
        <Setter Property="Preset" Value="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToTombolaSoftGlowPreset}}"/>
        <Style.Triggers>
            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_TombolaInfiniteFlash_Inverted}"/>
            </EventTrigger>
        </Style.Triggers>
    </Style>

    <Double x:Key="A_Double_Logo_Height">750</Double>
    <Double x:Key="A_Double_Logo_Width">750</Double>

    <Style x:Key="A_Style_FZMaterial_HatFlash" TargetType="FZMaterial">
        <Setter Property="Width" Value="{StaticResource A_Double_Logo_Width}"/>
        <Setter Property="Height" Value="{StaticResource A_Double_Logo_Height}"/>
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Yellow}"/>
        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Logo/Tank_Flashy_Hat.png"/>
        <Style.Triggers>
            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                <BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_TombolaInfiniteFlash}"/>
            </EventTrigger>
            <DataTrigger Binding="{Binding IsSuper}" Value="True">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Super/Logo/Tank_Flashy_Hat.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="A_Template_Tanky_Wheelspin_Logo" TargetType="ContentControl">
        <ControlTemplate.Resources>
            <Style x:Key="A_Style_FZMaterial_TombolaLogoFrame" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="{StaticResource A_Double_Logo_Width}"/>
                <Setter Property="Height" Value="{StaticResource A_Double_Logo_Height}"/>
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Logo/Tanky_Wheelspin_Logo_Background.png"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_TombolaLogo" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="{StaticResource A_Double_Logo_Width}"/>
                <Setter Property="Height" Value="{StaticResource A_Double_Logo_Height}"/>
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Logo/Tanky_Wheelspin_Logo.png"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_TombolaLogoSpinner" TargetType="FZMaterial">
                <Setter Property="Width" Value="{StaticResource A_Double_Logo_Width}"/>
                <Setter Property="Height" Value="{StaticResource A_Double_Logo_Height}"/>
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Normal/Logo/Tanky_Wheelspin_Logo_Spinner.png"/>
                <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <RotateTransform Angle="{Binding LogoSpinnerRotation, RelativeSource={RelativeSource AncestorType=Page}}"/>
                    </Setter.Value>
                </Setter>
            </Style>
        </ControlTemplate.Resources>
        <Grid Visibility="{Binding ShowLogo, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}}"> 
            <FZMaterial x:Name="Frame" Style="{StaticResource A_Style_FZMaterial_TombolaLogoFrame}" />
            <FZMaterial x:Name="Spinner" Style="{StaticResource A_Style_FZMaterial_TombolaLogoSpinner}"/>
            <FZMaterial x:Name="Tanky" Style="{StaticResource A_Style_FZMaterial_TombolaLogo}" />
            <ContentPresenter/>
        </Grid>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding IsSuper}" Value="True">
                <Setter TargetName="Spinner" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Super/Logo/Tanky_Wheelspin_Logo_Spinner.png"/>
                <Setter TargetName="Frame" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Super/Logo/Tanky_Wheelspin_Logo_Background.png"/>
                <Setter TargetName="Tanky" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Super/Logo/Tanky_Wheelspin_Logo.png"/>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

</ResourceDictionary>
