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

    <DropShadowEffect x:Key="A_DropShadow_ActivityInfoPanel" BlurRadius="0" ShadowDepth="2.5" Color="{StaticResource A_Color_HUDDropShadow}" />

    <Style TargetType="{x:Type local:FZRun}" 
        x:Key="A_Style_FZRun_ActivityInfoPanel_HIGHLIGHT">
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Green}"/>
    </Style>

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

    <Style x:Key="A_Style_FZTextBlock_ActivityInfoPanel_LineBase"
           TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="FontFamily" Value="Horizon_C"/>
        <Setter Property="LineAdjust" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="TextAlignment" Value="Left" />
        <Setter Property="Opacity" Value="1"/>
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
        <Setter Property="Effect" Value="{StaticResource A_DropShadow_ActivityInfoPanel}"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ActivityInfoPanel_Line1"
           TargetType="{x:Type local:FZTextBlock}"
           BasedOn="{StaticResource A_Style_FZTextBlock_ActivityInfoPanel_LineBase}">
        <Setter Property="CapHeight" Value="20"/>
    </Style>

    <MappingConverter x:Key="A_LangStrToActivityInfoPanelLine2LineAdjust" Default="-0.65">
        <!-- same diacritics, spacing is the same -->
        <MappingConverterEntry Key="BR" Value="-0.55"/>
        <MappingConverterEntry Key="DE" Value="-0.55"/>
        <MappingConverterEntry Key="ES" Value="-0.55"/>
        <MappingConverterEntry Key="FR" Value="-0.55"/>
        <MappingConverterEntry Key="HU" Value="-0.55"/>
        <MappingConverterEntry Key="IT" Value="-0.55"/>
        <MappingConverterEntry Key="MX" Value="-0.55"/>
        <!-- end of same diacritics -->
        <MappingConverterEntry Key="CHS" Value="-0.45"/>
        <MappingConverterEntry Key="CHT" Value="-0.45"/>
        <MappingConverterEntry Key="JP" Value="-0.45"/>
        <MappingConverterEntry Key="KO" Value="-0.5"/>
        <MappingConverterEntry Key="CZ" Value="-0.51"/>
        <MappingConverterEntry Key="PL" Value="-0.5"/>
        <MappingConverterEntry Key="RU" Value="-0.53"/>
        <MappingConverterEntry Key="TR" Value="-0.57"/>
    </MappingConverter>

    <Style x:Key="A_Style_FZTextBlock_ActivityInfoPanel_Line2"
           TargetType="{x:Type local:FZTextBlock}"
           BasedOn="{StaticResource A_Style_FZTextBlock_ActivityInfoPanel_LineBase}">
        <Setter Property="CapHeight" Value="55"/>
        <Setter Property="LineAdjust" Value="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToActivityInfoPanelLine2LineAdjust}}"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="MaxHeight" Value="175"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ActivityInfoPanel_Description"
           TargetType="{x:Type local:FZTextBlock}"
           BasedOn="{StaticResource A_Style_FZTextBlock_ActivityInfoPanel_Line2}">
        <Setter Property="CapHeight" Value="20"/>
        <Setter Property="LineAdjust" Value="-0.4"/>
        <Setter Property="FontFamily" Value="Horizon_A"/>
    </Style>

    <MappingConverter x:Key="A_LangStrToActivityInfoPanelLine1And2SpacingHeight" Default="22">
        <!-- same diacritics, spacing is the same -->
        <MappingConverterEntry Key="BR" Value="36"/>
        <MappingConverterEntry Key="DE" Value="36"/>
        <MappingConverterEntry Key="ES" Value="36"/>
        <MappingConverterEntry Key="FR" Value="36"/>
        <MappingConverterEntry Key="HU" Value="36"/>
        <MappingConverterEntry Key="IT" Value="36"/>
        <MappingConverterEntry Key="MX" Value="36"/>
        <!-- end of same diacritics -->
        <MappingConverterEntry Key="CHS" Value="36"/>
        <MappingConverterEntry Key="CHT" Value="30"/>
        <MappingConverterEntry Key="JP" Value="36"/>
        <MappingConverterEntry Key="KO" Value="36"/>
        <MappingConverterEntry Key="CZ" Value="40"/>
        <MappingConverterEntry Key="PL" Value="40"/>
        <MappingConverterEntry Key="RU" Value="40"/>
        <MappingConverterEntry Key="TR" Value="44"/>
    </MappingConverter>

    <Double x:Key="A_Double_ActivityInfoPanel_InOffset">-10</Double>
    <Double x:Key="A_Double_ActivityInfoPanel_OutOffset">10</Double>
    <Duration x:Key="A_Duration_ActivityInfoPanel_Transition">0:0:0.5</Duration>
    <Duration x:Key="A_Duration_ActivityInfoPanel_Delay">0:0:0.5</Duration>

    <local:UIPageTransition x:Key="A_UIPageTransition_ActivityInfoPanel_In"
        DurationSpread="{StaticResource A_Duration_ActivityInfoPanel_Transition}"
        TransitionDelay="{StaticResource A_Duration_ActivityInfoPanel_Delay}" />

    <local:UIPageTransition x:Key="A_UIPageTransition_ActivityInfoPanel_Out"
        DurationSpread="{StaticResource A_Duration_Transition_Spread}"
        TransitionDelay="{StaticResource A_Duration_ActivityInfoPanel_Delay}" />

    <local:UIPageTransitionManagerPreset x:Key="A_UIPageTransitionManagerPreset_ActivityInfoPanel"
        TransitionInForwards="{StaticResource A_UIPageTransition_ActivityInfoPanel_In}"
        TransitionInBack="{StaticResource A_UIPageTransition_ActivityInfoPanel_In}"
        TransitionOutForwards="{StaticResource A_UIPageTransition_ActivityInfoPanel_Out}"
        TransitionOutBack="{StaticResource A_UIPageTransition_ActivityInfoPanel_Out}"/>

    <Style x:Key="A_Style_FrameworkElement_ActivityInfoPanelTransition" TargetType="{Type FrameworkElement}">
        <Style.Resources>
            <Storyboard x:Key="PART_transition_in">
                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="{x:Null}" Duration="{StaticResource A_Duration_ActivityInfoPanel_Transition}" From="0" To="1"/>
                <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="{x:Null}" Duration="{StaticResource A_Duration_ActivityInfoPanel_Transition}" From="-10" To="0"/>
            </Storyboard>
            <Storyboard x:Key="PART_transition_out_forward">
                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="{x:Null}" Duration="{StaticResource A_Duration_ActivityInfoPanel_Transition}" From="1" To="0"/>
                <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="{x:Null}" Duration="{StaticResource A_Duration_ActivityInfoPanel_Transition}" From="0" To="10"/>
            </Storyboard>
            <Storyboard x:Key="PART_transition_out_back">
                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="{x:Null}" Duration="{StaticResource A_Duration_ActivityInfoPanel_Transition}" From="1" To="0"/>
                <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="{x:Null}" Duration="{StaticResource A_Duration_ActivityInfoPanel_Transition}" From="0" To="10"/>
            </Storyboard>
        </Style.Resources>
        <Setter Property="local:UIPageTransitionManager.TransitionIndex" Value="0" />
        <Setter Property="local:UIPageTransitionManager.TransitionTags" Value="ActivityInfoPanel" />
        <Setter Property="Opacity" Value="1"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TranslateTransform />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FrameworkElement_ActivityInfoPanelTransition_0" TargetType="{x:Type FrameworkElement}" BasedOn="{StaticResource A_Style_FrameworkElement_ActivityInfoPanelTransition}">
        <Setter Property="local:UIPageTransitionManager.TransitionIndex" Value="0" />
    </Style>

    <Style x:Key="A_Style_FrameworkElement_ActivityInfoPanelTransition_1" TargetType="{x:Type FrameworkElement}" BasedOn="{StaticResource A_Style_FrameworkElement_ActivityInfoPanelTransition}">
        <Setter Property="local:UIPageTransitionManager.TransitionIndex" Value="1" />
    </Style>

    <Style x:Key="A_Style_FrameworkElement_ActivityInfoPanelTransition_2" TargetType="{x:Type FrameworkElement}" BasedOn="{StaticResource A_Style_FrameworkElement_ActivityInfoPanelTransition}">
        <Setter Property="local:UIPageTransitionManager.TransitionIndex" Value="2" />
    </Style>

    <DataTemplate DataType="{Type ActivityInfoPanelDataSource}">
        <StackPanel>
            <Decorator Style="{StaticResource A_Style_FrameworkElement_ActivityInfoPanelTransition_0}">
                <Decorator.RenderTransform>
                    <TranslateTransform x:Name="Text1Translation"/>
                </Decorator.RenderTransform>
                <local:FZTextBlock x:Name="Line1Text"
                                    Style="{StaticResource A_Style_FZTextBlock_ActivityInfoPanel_Line1}"
                                    MarkupConverter="{StaticResource A_MappingConverter_ActivityInfoPanel}"
                                    Text="{Binding Line1}"/>
            </Decorator>
            <Decorator Height="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToActivityInfoPanelLine1And2SpacingHeight}}" />
            <Decorator Style="{StaticResource A_Style_FrameworkElement_ActivityInfoPanelTransition_1}"
                RenderTransformOrigin="0.5,0.5" Margin="-5,0,0,0">
                <Decorator.RenderTransform>
                    <TranslateTransform x:Name="Text2Translation"/>
                </Decorator.RenderTransform>
                <local:FZTextBlock x:Name="Line2Text"
                                   Text="{Binding Line2}"
                                   Style="{StaticResource A_Style_FZTextBlock_ActivityInfoPanel_Line2}"/>
            </Decorator>
            <Decorator Height="30" Visibility="{Binding Description, Converter={StaticResource A_StringVisConverter}}"/>
            <Decorator Style="{StaticResource A_Style_FrameworkElement_ActivityInfoPanelTransition_2}"
                RenderTransformOrigin="0.5,0.5">
                <Decorator.RenderTransform>
                    <TranslateTransform x:Name="DescriptionTextTranslation"/>
                </Decorator.RenderTransform>
                <local:FZTextBlock x:Name="UGCDescriptionText"
                                   Text="{Binding Description}"
                                   Style="{StaticResource A_Style_FZTextBlock_ActivityInfoPanel_Description}"
                                   Visibility="{Binding Description, Converter={StaticResource A_StringVisConverter}}"/>
            </Decorator>
        </StackPanel>
    </DataTemplate>

    <Style x:Key="A_Style_ContentControl_ActivityInfoPanel" TargetType="{Type ContentControl}">
        <Setter Property="Margin" Value="76,165"/>
        <Setter Property="MaxWidth" Value="800"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
    </Style>

</ResourceDictionary>