<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">611</System:Double>
    <System:Double x:Key="A_Double_TombolaSpinnerWidth">426</System:Double>
    <System:Double x:Key="A_Double_TicketWidth">364</System:Double>
    <System:Double x:Key="A_Double_TicketHeight">227</System:Double>
    <System:Double x:Key="A_Double_TicketHeightWithMargin">245</System:Double>
    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_ListHeight"
                                    Scale="{StaticResource A_Double_TicketHeightWithMargin}"/>
    <Thickness x:Key="A_Thickness_TicketToPrizeBoxOuterBorder">-24</Thickness>
    <Thickness x:Key="A_Thickness_TicketToPrizeBoxInnerBorder">-12</Thickness>
    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_AnimationValueScale"
                                    Scale="{StaticResource A_Double_TicketHeightWithMargin}"
                                    Add="-312.5" />

    <!-- These resources are referenced from the code-behind. Removing them WILL cause a crash. -->
    <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_TombolaLeftWindUpTime">0:0:0.66</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaMidWindUpTime">0:0:0.66</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaRightWindUpTime">0:0:0.66</KeyTime>

    <KeyTime x:Key="PART_A_KeyTime_TombolaLeftLandingTime">0:0:5.0</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaMidLandingTime">0:0:5.7</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaRightLandingTime">0:0:6.17</KeyTime>

    <KeyTime x:Key="PART_A_KeyTime_TombolaLeftLockInTime">0:0:5.57</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaMidLockInTime">0:0:6.27</KeyTime>
    <KeyTime x:Key="PART_A_KeyTime_TombolaRightLockInTime">0:0:6.67</KeyTime>

    <System:TimeSpan x:Key="PART_A_TimeSpan_TombolaSkipOffset">0:0:4.0</System:TimeSpan>

    <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_TombolaRightLockInTime}"
                Offset="{StaticResource A_TimeSpan_TombolaLockInToCanSpinAgainDelay}"/>

    <!-- 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>
    
    <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_TombolaLeftWindUpTime}"
        Offset="{StaticResource A_TimeSpan_TombolaSkipEnabledOffset}"/>


    <local:OffsetKeyTime x:Key="A_KeyTime_TombolaPlayWinAudio"
        KeyTime="{StaticResource PART_A_KeyTime_TombolaLeftLockInTime}"
        Offset="-0:0:0.25"/>

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

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

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

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

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

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

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

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

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

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

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

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


    <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="40" />
        <Setter Property="Text" Value="{Binding PrizeValue, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" />
        <Setter Property="Stretch" Value="None" />
    </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="TextAlignment" Value="Center" />
        <Setter Property="Color" Value="{StaticResource A_Color_Tombola_PrizeText}"/>
        <Setter Property="CapHeight" Value="21" />
        <Setter Property="AutoScroll" Value="{StaticResource A_AutoScrollSettings_PrizeName}" />
        <Setter Property="AutoScroll.AllowScrolling" Value="False" />
        <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_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="TextAlignment" Value="Center" />
        <Setter Property="Color" Value="{StaticResource A_Color_Tombola_PrizeText}" />
        <Setter Property="CapHeight" Value="18" />
        <Setter Property="AutoScroll" Value="{StaticResource A_AutoScrollSettings_PrizeName}" />
        <Setter Property="AutoScroll.AllowScrolling" Value="False" />
        <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/Super/Drum_background.png" />
        <Setter Property="Width" Value="1334" />
        <Setter Property="Height" Value="633" />
    </Style>
    
    <Style x:Key="A_Style_FZMaterial_TombolaDrumForeground"
           TargetType="local:FZMaterial">
        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Tombola/Super/Drum_Foreground.png" />
        <Setter Property="Width" Value="426" />
        <Setter Property="Height" Value="611" />
    </Style>

    <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 ImageSource="/ForzaUI;component/Textures/Anthem/Tombola/Super/Prize_Backing_Credits.png" >
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                MaxWidth="314">
                        <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">66</GridLength>
    <GridLength x:Key="A_GridLength_TombolaTicket_PrizeBottom">66</GridLength>

    <Style x:Key="A_Style_FZMaterial_TextBackground" TargetType="FZMaterial">
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
        <Setter Property="Opacity" Value="0.6"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Height" Value="40"/>
    </Style>

    <DataTemplate DataType="{x:Type local:TombolaTicketCar}">
        <DataTemplate.Resources>
            <Double x:Key="A_Double_ContentMaxWidth">330</Double>
        </DataTemplate.Resources>
        <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/Super/Prize_Backing_Car.png">
                    <Grid Margin="16">
                        <FZMaterial Width="275"
                                    Height="160"
                                    Stretch="Uniform"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Margin="0,25,0,0"
                                    ImageSource="{Binding ForegroundImage}"
                                    Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={FZBooleanToVisibilityConverter}}"/>
                        <Control Style="{StaticResource A_Style_Control_SuperTombolaHorizonEditionBlammo}"
                            VerticalAlignment="Bottom"
                            HorizontalAlignment="Center"/>
                        
                        <FZMaterial Style="{StaticResource A_Style_FZMaterial_TextBackground}"
                                    Height="72"/>

                        <StackPanel VerticalAlignment="Top"
                                    HorizontalAlignment="Center">
                                <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarModel}"
                                    Text="{Binding CarModel}"
                                    HorizontalAlignment="Center"
                                    MaxWidth="{StaticResource A_Double_ContentMaxWidth}"/>
                                <FZTextBlock
                                    Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarManufacturer}"
                                    Text="{Binding CarManufacturer, Converter={StaticResource A_StringToUpper}}"                                   
                                    HorizontalAlignment="Center"
                                    MaxWidth="{StaticResource A_Double_ContentMaxWidth}"/>
                        </StackPanel>
                </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/Super/Prize_Backing_Car_HorizonEdition.png" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:TombolaTicketEmote}">
        <DataTemplate.Resources>
            <Double x:Key="A_Double_ContentMaxWidth">330</Double>
        </DataTemplate.Resources>
        <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/Super/Prize_Backing_Emotes.png">
                    <Grid Margin="16" MaxWidth="{StaticResource A_Double_ContentMaxWidth}">
                        <FZMaterial Width="150"
                                    Height="150"
                                    Stretch="Uniform"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Bottom"
                                    ImageSource="{Binding ForegroundImage}"
                                    Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={FZBooleanToVisibilityConverter}}"/>
                        
                        <FZMaterial Style="{StaticResource A_Style_FZMaterial_TextBackground}"/>

                        <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarModel}"
                            VerticalAlignment="Top"
                            HorizontalAlignment="Center"
                            MaxWidth="{StaticResource A_Double_ContentMaxWidth}"
                            Text="{Binding PrizeName}"/>
                    </Grid>
                </local:FZMaterial>
            </local:FZMaterial>
        </Decorator>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:TombolaTicketHorn}">
        <DataTemplate.Resources>
            <Double x:Key="A_Double_ContentMaxWidth">330</Double>
        </DataTemplate.Resources>
        <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/Super/Prize_Backing_Horn.png">
                    <Grid Margin="16">
                        <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarModel}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Top"
                            MaxWidth="{StaticResource A_Double_ContentMaxWidth}"
                            Text="{Binding PrizeName, Converter={StaticResource A_StringToUpper}}"
                            Effect="{StaticResource A_Effect_HighContrastModeDropShadow_Large}" />

                        <Control Template="{StaticResource A_Template_HornPrize_Image}"
                                 Height="120"
                                 Width="120"
                                 VerticalAlignment="Bottom"
                                 Margin="0,0,0,20"/>
                    </Grid>
                </local:FZMaterial>
            </local:FZMaterial>
        </Decorator>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:TombolaTicketClothing}">
        <DataTemplate.Resources>
            <Double x:Key="A_Double_ContentMaxWidth">330</Double>
        </DataTemplate.Resources>
        <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/Super/Prize_Backing_Emotes.png">
                    <Grid Margin="16" MaxWidth="{StaticResource A_Double_ContentMaxWidth}">
                        <FZMaterial Width="140"
                                    Height="140"
                                    Stretch="Uniform"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    ImageSource="{Binding ForegroundImage}"
                                    Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={FZBooleanToVisibilityConverter}}"/>

                        <FZMaterial Style="{StaticResource A_Style_FZMaterial_TextBackground}"/>

                        <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_CarPrizeDetails_CarModel}"
                            MaxWidth="{StaticResource A_Double_ContentMaxWidth}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Top"
                            Text="{Binding PrizeName}" />
                    </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_Base"
        TargetType="{x:Type FrameworkElement}">
        <Setter Property="Height" Value="{StaticResource A_Double_TombolaSpinnerHeight}"/>
        <Setter Property="Width" Value="{StaticResource A_Double_TombolaSpinnerWidth}"/>
    </Style>

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

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

    <FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangle_SuperTombolaHardGlow"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_SuperTombolaOuterBorder}"/>

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

    <Style x:Key="A_Style_FZMaterial_WinningPrizeHardGlow_SuperTombola"
        TargetType="{x:Type local:FZMaterial}"
        BasedOn="{StaticResource A_Style_FZMaterial_WinningPrizeHardGlow}">
        <Setter Property="Preset" Value="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToSuperTombolaHardGlowPreset}}"/>
        <Setter Property="Color" Value="{Binding PrizeRarity, Converter={StaticResource A_Converter_RarityToColor}}"/>
    </Style>

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

    <ControlTemplate x:Key="A_Template_SuperTombola_FlashGlow" TargetType="ContentControl">
        <Grid x:Name="SpinnerContainer_Glows"
              Opacity="0">
            <ContentPresenter/>
        </Grid>
        <ControlTemplate.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding AnimationState}" Value="{x:Static local:TombolaAnimationStates.Spinning}"/>
                    <Condition Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="Left"/>
                </MultiDataTrigger.Conditions>
                <DataTrigger.EnterActions>
                    <BeginUIStoryboard x:Name="BeginStoryboard_SuperTombola_Panel_LeftGlow">
                        <UIStoryboard>
                            <DoubleAnimationUsingKeyFrames
                                Storyboard.TargetName="SpinnerContainer_Glows"
                                Storyboard.TargetProperty="(UIElement.Opacity)">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0.0"/>
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaLeftPrizeGlowFadeInStart}" Value="0.0"/>
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaLeftPrizeGlowFadeInEnd}" Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}"/>
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaLeftPrizeGlowFadeOutStart}" Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}"/>
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaLeftPrizeGlowFadeOutEnd}" Value="0.0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </UIStoryboard>
                    </BeginUIStoryboard>
                </DataTrigger.EnterActions>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding AnimationState}" Value="{x:Static local:TombolaAnimationStates.Spinning}"/>
                    <Condition Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="Mid"/>
                </MultiDataTrigger.Conditions>
                <DataTrigger.EnterActions>
                    <BeginUIStoryboard x:Name="BeginStoryboard_SuperTombola_Panel_MidGlow">
                        <UIStoryboard>
                             <DoubleAnimationUsingKeyFrames
                                Storyboard.TargetName="SpinnerContainer_Glows"
                                Storyboard.TargetProperty="(UIElement.Opacity)">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0.0"/>
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaMidPrizeGlowFadeInStart}" Value="0.0"/>
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaMidPrizeGlowFadeInEnd}" Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}"/>
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaMidPrizeGlowFadeOutStart}" Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}"/>
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaMidPrizeGlowFadeOutEnd}" Value="0.0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </UIStoryboard>
                    </BeginUIStoryboard>
                </DataTrigger.EnterActions>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding AnimationState}" Value="{x:Static local:TombolaAnimationStates.Spinning}"/>
                    <Condition Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="Right"/>
                </MultiDataTrigger.Conditions>
                <DataTrigger.EnterActions>
                    <BeginUIStoryboard x:Name="BeginStoryboard_SuperTombola_Panel_RightGlow">
                        <UIStoryboard>
                             <DoubleAnimationUsingKeyFrames
                                Storyboard.TargetName="SpinnerContainer_Glows"
                                Storyboard.TargetProperty="(UIElement.Opacity)">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0.0"/>
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaRightPrizeGlowFadeInStart}" Value="0.0"/>
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaRightPrizeGlowFadeInEnd}" Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}"/>
                                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaRightPrizeGlowFadeOutStart}" Value="{StaticResource A_Double_TombolaPrizeGlowFlashOpacity}"/>
                                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TombolaRightPrizeGlowFadeOutEnd}" Value="0.0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </UIStoryboard>
                    </BeginUIStoryboard>
                </DataTrigger.EnterActions>
            </MultiDataTrigger> 
            <DataTrigger Binding="{Binding IsSkipComplete}" Value="True">
                <DataTrigger.EnterActions>
                    <SeekStoryboard BeginStoryboardName="BeginStoryboard_SuperTombola_Panel_LeftGlow"
                        Offset="{StaticResource PART_A_TimeSpan_TombolaSkipOffset}"
                        Origin="{x:Static TimeSeekOrigin.BeginTime}"/>
                    <SeekStoryboard BeginStoryboardName="BeginStoryboard_SuperTombola_Panel_MidGlow"
                        Offset="{StaticResource PART_A_TimeSpan_TombolaSkipOffset}"
                        Origin="{x:Static TimeSeekOrigin.BeginTime}"/>
                    <SeekStoryboard BeginStoryboardName="BeginStoryboard_SuperTombola_Panel_RightGlow"
                        Offset="{StaticResource PART_A_TimeSpan_TombolaSkipOffset}"
                        Origin="{x:Static TimeSeekOrigin.BeginTime}"/>
                </DataTrigger.EnterActions>
            </DataTrigger>
        </ControlTemplate.Triggers>              
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_TombolaBorder" TargetType="Control">
        <Grid Width="{StaticResource A_Double_TombolaSpinnerWidth}"
              Height="{StaticResource A_Double_TombolaSpinnerHeight}">

            <ContentControl Template="{StaticResource A_Template_TombolaPrizeBorder}"
                            Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType=Control}}">
                <Grid>
                    <Grid X:Name="Arrows"
                          VerticalAlignment="Center">
                        <FZMaterial Style="{StaticResource A_Style_FZMaterial_Arrow_Left}"
                                    Margin="5"/>
                        <FZMaterial Style="{StaticResource A_Style_FZMaterial_Arrow_Right}"
                                    Margin="5"/>
                    </Grid>
                    
                    <ContentControl Template="{StaticResource A_Template_SuperTombola_FlashGlow}"
                                    Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType=Control}}">
                        <Grid>
                            <Decorator x:Name="SpinnerContainer_SoftGlow"
                                    Style="{StaticResource A_Style_FrameworkElement_SpinnerContainer_Base}"
                                    Margin="{StaticResource A_Thickness_TicketToPrizeBoxOuterBorder}">
                                <Grid Margin="{StaticResource A_Thickness_TicketToPrizeBoxOuterBorder}">
                                    <FZMaterial x:Name="SoftGlow"
                                                Style="{StaticResource A_Style_FZMaterial_WinningPrizeSoftGlow}"/>
                                </Grid>
                            </Decorator>
                            <Decorator x:Name="SpinnerContainer_HardGlow"
                                    Style="{StaticResource A_Style_FrameworkElement_SpinnerContainer_Base}"
                                    Margin="0">
                                <Grid x:Name="HardGlow">
                                    <FZMaterial Style="{StaticResource A_Style_FZMaterial_WinningPrizeHardGlow_SuperTombola}"/>
                                    <FZMaterial Style="{StaticResource A_Style_FZMaterial_WinningPrizeHardGlow_Arrows_Tombola}"
                                                Margin="5"
                                                Tag="Left"/>
                                    <FZMaterial Style="{StaticResource A_Style_FZMaterial_WinningPrizeHardGlow_Arrows_Tombola}"
                                                Margin="5"
                                                Tag="Right"/>
                                </Grid>
                            </Decorator>
                        </Grid>
                    </ContentControl>
                </Grid>
            </ContentControl>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="Tag" Value="Left">
                <Setter TargetName="SoftGlow" Property="DataContext" Value="{Binding WinningTickets[0]}"/>
                <Setter TargetName="HardGlow" Property="DataContext" Value="{Binding WinningTickets[0]}"/>
            </Trigger>
            <Trigger Property="Tag" Value="Mid">
                <Setter TargetName="SoftGlow" Property="DataContext" Value="{Binding WinningTickets[1]}"/>
                <Setter TargetName="HardGlow" Property="DataContext" Value="{Binding WinningTickets[1]}"/>
            </Trigger>
            <Trigger Property="Tag" Value="Right">
                <Setter TargetName="SoftGlow" Property="DataContext" Value="{Binding WinningTickets[2]}"/>
                <Setter TargetName="HardGlow" Property="DataContext" Value="{Binding WinningTickets[2]}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ContentTemplate_SuperTombolaPanel_Foreground_Background" TargetType="ContentControl">
        <ControlTemplate.Resources>
            <Style x:Key="A_Style_FZMaterial_SuperTombola_PanelBackground" TargetType="FZMaterial"
                BasedOn="{StaticResource A_Style_FrameworkElement_SpinnerContainer_Base}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
                <Setter Property="Opacity" Value="0.4"/>
                <Setter Property="Preset" Value="{Roundtangle CornerRadius=16}"/>
            </Style>
        </ControlTemplate.Resources>
        <Grid>
            <FZMaterial x:Name="TombolaBackground"
                        Style="{StaticResource A_Style_FZMaterial_SuperTombola_PanelBackground}"/>
            <Grid ClipToBounds="True">
                <ContentPresenter/>
            </Grid>
            <FZMaterial Style="{StaticResource A_Style_FZMaterial_TombolaDrumForeground}" 
                        HorizontalAlignment="Center">
                <Control Template="{StaticResource A_ControlTemplate_TombolaBorder}"
                         Tag="{TemplateBinding Tag}"/>
            </FZMaterial>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_SuperTombolaPanelContents">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="18"/>
                <ColumnDefinition />
                <ColumnDefinition Width="18"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <!-- Spinner Blocks -->
            <ContentControl x:Name="SpinnerBlockLeft"
                            Template="{StaticResource A_ContentTemplate_SuperTombolaPanel_Foreground_Background}"
                            Grid.Column="0"
                            Tag="Left">
                <Grid ClipToBounds="True"
                      Style="{StaticResource A_Style_Grid_MotionBlur}"
                      Margin="0,-20"
                      local:MotionBlurEffect.MotionBlurPositionYControl="{Binding (Control.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y), ElementName=TicketListLeft}">
                    <ItemsControl DataContext="{Binding TicketLists[0]}"
                        Style="{StaticResource A_Style_TicketsList}"
                        x:Name="TicketListLeft">
                        <ItemsControl.RenderTransform>
                            <TransformGroup>
                                <TranslateTransform Y="{Binding TicketListsTranslateY0, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_LinearTransformConverter_AnimationValueScale}}" />
                            </TransformGroup>
                        </ItemsControl.RenderTransform>
                    </ItemsControl>
                </Grid>
            </ContentControl>

            <ContentControl x:Name="SpinnerBlockMid"
                            Template="{StaticResource A_ContentTemplate_SuperTombolaPanel_Foreground_Background}"
                            Grid.Column="2"
                            Tag="Mid">
                <Grid ClipToBounds="True"
                      Style="{StaticResource A_Style_Grid_MotionBlur}"
                      Margin="0,-20"
                      local:MotionBlurEffect.MotionBlurPositionYControl="{Binding (Control.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y), ElementName=TicketListMid}">
                    <ItemsControl DataContext="{Binding TicketLists[1]}"
                        Style="{StaticResource A_Style_TicketsList}"
                        x:Name="TicketListMid">
                        <ItemsControl.RenderTransform>
                            <TransformGroup>
                                <TranslateTransform Y="{Binding TicketListsTranslateY1, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_LinearTransformConverter_AnimationValueScale}}" />
                            </TransformGroup>
                        </ItemsControl.RenderTransform>
                    </ItemsControl>
                </Grid>
            </ContentControl>

            <ContentControl x:Name="SpinnerBlockRight"
                            Template="{StaticResource A_ContentTemplate_SuperTombolaPanel_Foreground_Background}"
                            Grid.Column="4"
                            Tag="Right">
                <Grid ClipToBounds="True"
                      Style="{StaticResource A_Style_Grid_MotionBlur}"
                      Margin="0,-20"
                      local:MotionBlurEffect.MotionBlurPositionYControl="{Binding (Control.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y), ElementName=TicketListRight}">
                    <ItemsControl DataContext="{Binding TicketLists[2]}"
                        Style="{StaticResource A_Style_TicketsList}"
                        x:Name="TicketListRight">
                        <ItemsControl.RenderTransform>
                            <TransformGroup>
                                <TranslateTransform Y="{Binding TicketListsTranslateY2, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_LinearTransformConverter_AnimationValueScale}}" />
                            </TransformGroup>
                        </ItemsControl.RenderTransform>
                    </ItemsControl>
                </Grid>
            </ContentControl>
        </Grid>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding AnimationState}" Value="{x:Static local:TombolaAnimationStates.Spinning}">
                <DataTrigger.EnterActions>
                    <local:BeginUIStoryboard x:Name="BeginStoryboard_SuperTombola_Panel">
                        <local:UIStoryboard>
                            <local:UIStoryboard.TriggerAnimation>
                                <local:RaiseFzEvent EventName="SkipEnabled"
                                    local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TombolaSkipEnabledTime}"/>
                                <local:RaiseFzEvent EventName="SkipDisabled"
                                    local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TombolaSkipDisabledTime}"/>
                                <local:RaiseFzEvent EventName="SpinComplete"
                                    local:TriggerAnimation.KeyTime="{StaticResource PART_A_KeyTime_TombolaRightLockInTime}"/>
                                    <local:RaiseFzEvent EventName="CanSpinAgain"
                                        local:TriggerAnimation.KeyTime="{StaticResource PART_A_KeyTime_TombolaSpinAgainTime}" />
                                <local:RaiseFzEvent EventName="PlayWinAudio"
                                    local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TombolaPlayWinAudio}"/>
                                <local:StartAudioTrigger EventName="AudioUITrigger_SuperWheelSpin_Spin"
                                    local:TriggerAnimation.KeyTime="0:0:0.0"/>
                            </local:UIStoryboard.TriggerAnimation>
                        </local:UIStoryboard>
                    </local:BeginUIStoryboard>
                </DataTrigger.EnterActions>
            </DataTrigger>

            <DataTrigger Binding="{Binding IsSkipComplete}" Value="True">
                <DataTrigger.EnterActions>
                    <SeekStoryboard BeginStoryboardName="BeginStoryboard_SuperTombola_Panel"
                        Offset="{StaticResource PART_A_TimeSpan_TombolaSkipOffset}"
                        Origin="{x:Static TimeSeekOrigin.BeginTime}"/>
                </DataTrigger.EnterActions>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="A_Style_Control_SuperTombolaPanelContents"
        TargetType="{x:Type Control}">
        <Setter Property="Height" Value="600"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_SuperTombolaPanelContents}"/>
    </Style>
            
</ResourceDictionary>
