<UserControl
    DataContext="{Binding (HUDData.Data), RelativeSource={RelativeSource Self}}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:local="clr-namespace:ForzaUI" 
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    x:Class="ForzaUI.HUDInfoFeedControl"
    HorizontalAlignment="Left"
    VerticalAlignment="Bottom"
    Margin="0,0,0,312"
    x:Name="UserControl">

    <UserControl.Resources>
        <ResourceDictionary>

            <Style x:Key="A_Style_FZMaterial_Feed_InlineIcon" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="35"/>
                <Setter Property="Height" Value="35"/>
                <Setter Property="Margin" Value="0,-8,0,-7"/>
            </Style>

            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_HIGHLIGHT" TargetType="local:FZRun">
                <Setter Property="Color"  Value="{StaticResource A_Color_Eliminator}"/>
            </Style>
            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER1" TargetType="local:FZRun">
                <Setter Property="Color"  Value="{StaticResource A_Color_EliminatorCarGrade_Tier1_GradientA}"/>
            </Style>
            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER2" TargetType="local:FZRun">
                <Setter Property="Color"  Value="{StaticResource A_Color_EliminatorCarGrade_Tier2_GradientA}"/>
            </Style>
            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER3" TargetType="local:FZRun">
                <Setter Property="Color"  Value="{StaticResource A_Color_EliminatorCarGrade_Tier3_GradientA}"/>
            </Style>
            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER4" TargetType="local:FZRun">
                <Setter Property="Color"  Value="{StaticResource A_Color_EliminatorCarGrade_Tier4_GradientA}"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_EliminatorFeed_InlineIcon_Highlighted" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_Feed_InlineIcon}">
                <Setter Property="Color" Value="{StaticResource A_Color_Eliminator}"/>
            </Style>

            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_ELIMINATED" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/InfoFeed/Eliminated.png" Style="{StaticResource A_Style_FZMaterial_Feed_InlineIcon}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_ARENA" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/InfoFeed/ArenaWall.png" Style="{StaticResource A_Style_FZMaterial_EliminatorFeed_InlineIcon_Highlighted}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <local:FZMaterialPresetGlassRoundtangle x:Key="A_FZMaterialPresetGlassRoundtangle_GlassPanel_2px"
                BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_Base}"
                CornerRadius="2,2,2,2"/>

            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_CAR" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/InfoFeed/NewCar.png" Style="{StaticResource A_Style_FZMaterial_Feed_InlineIcon}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="A_Style_FZRun_Markup_EliminatorFeedItem_TIMEOUT" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/InfoFeed/DNF.png" Style="{StaticResource A_Style_FZMaterial_EliminatorFeed_InlineIcon_Highlighted}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <MappingConverter x:Key="A_MappingConverter_EliminatorFeedItem" >
                    <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_HIGHLIGHT}" />
                    <MappingConverterEntry Key="{NoCase CarTier1}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER1}" />
                    <MappingConverterEntry Key="{NoCase CarTier2}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER2}" />
                    <MappingConverterEntry Key="{NoCase CarTier3}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER3}" />
                    <MappingConverterEntry Key="{NoCase CarTier4}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER4}" />
                    <MappingConverterEntry Key="{NoCase CarTier4}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_CARTIER4}" />
                    <MappingConverterEntry Key="{NoCase ELIMINATED}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_ELIMINATED}" />
                    <MappingConverterEntry Key="{NoCase ARENA}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_ARENA}" />
                    <MappingConverterEntry Key="{NoCase CAR}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_CAR}" />
                    <MappingConverterEntry Key="{NoCase TIMEOUT}" Value="{StaticResource A_Style_FZRun_Markup_EliminatorFeedItem_TIMEOUT}" />
            </MappingConverter>
            <local:FZMaterialPresetGlassRoundtangle x:Key="A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll"
        BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_Base}"
        CornerRadius="{StaticResource A_CornerRadius_Outer_All}"/>

            <DataTemplate DataType="{x:Type local:EliminatorFeedItem}" >
                <Grid HorizontalAlignment="Left" Height="35" Margin="0,2">

                    <local:FZMaterial x:Name="ItemPill" Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_2px}" 
                                      Color="{StaticResource A_Color_GlassPanel_NonInteractive}" Visibility="{Binding Message, Converter={StaticResource A_StringVisConverter}}">
                        <local:FZTextBlock MarkupConverter="{StaticResource A_MappingConverter_EliminatorFeedItem}"
                                       VerticalAlignment="Center"
                                       Text="{Binding Message}" Color="{StaticResource A_Color_White}"
                                       FontFamily="Horizon_A" CapHeight="14" Margin="8" TextWrapping="NoWrap"/>
                    </local:FZMaterial>
                </Grid>
            </DataTemplate>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="PART_LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.0"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="PART_Hidden">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_LayoutRoot">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState Name="PART_Shown"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <local:TickerItemsControl x:Name="Carousel" MaxWidth="400" VerticalAlignment="Bottom" AlternationCount="24"
                      ItemsSource="{Binding ActiveCollection}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Vertical" VerticalAlignment="Top" IsItemsHost="True" MinHeight="140"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemContainerStyle>
                <Style TargetType="{x:Type ContentPresenter}">
                    <Setter Property="HorizontalAlignment" Value="Left"/>
                </Style>
            </ItemsControl.ItemContainerStyle>
        </local:TickerItemsControl>
    </Grid>
</UserControl>