<Page
	xmlns:local="clr-namespace:ForzaUI"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	x:Class="ForzaUI.A_PreraceCutscene_TrackName"
	Style="{StaticResource A_Style_Page_Generic}"
    mc:Ignorable="d"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">

	<Page.Resources>
		<Color x:Key="A_Color_Cutscene_Subtitle_Foreground">#FFFFFE4B</Color>
		<Color x:Key="A_Color_Cutscene_Title_Foreground">#FFF5F5F5</Color>

		<Style x:Key="A_Style_FZTextBlock_Cutscene_Subtitle" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_Title}" >
			<Setter Property="FontSize" Value="130"/>
		</Style>
		<Style x:Key="A_Style_FZTextBlock_Cutscene_Title" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_Title}" >
			<Setter Property="FontSize" Value="250"/>
		</Style>

        <ControlTemplate x:Key="A_Template_Section1" TargetType="ContentControl">
            <Grid>
                <Grid Margin="0, 0, 0, 0">
                    <local:FZTextBlock Text="{Binding BucketName}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Subtitle}" Color="{StaticResource A_Color_DropShadow}" Margin="0,0,0,230" VerticalAlignment="Bottom" />
                    <local:FZTextBlock Text="{Binding BucketName}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Subtitle}" Color="{StaticResource A_Color_Cutscene_Subtitle_Foreground}" VerticalAlignment="Bottom" Margin="-5,0,0,235" />
                </Grid>
                <local:FZTextBlock Text="{Binding EventTitle}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Title}" Color="{StaticResource A_Color_DropShadow}" Margin="0,0,0,0" VerticalAlignment="Bottom" />
                <local:FZTextBlock Text="{Binding EventTitle}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Title}" Color="{StaticResource A_Color_Cutscene_Title_Foreground}" Margin="-6,0,0,6" VerticalAlignment="Bottom" />
            </Grid>
        </ControlTemplate>

        <ControlTemplate x:Key="A_Template_Section2" TargetType="ContentControl">
            <Grid>
                <Grid Margin="0, 0, 0, 0">
                    <local:FZTextBlock Text="{Binding EventProgress}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Subtitle}" Color="{StaticResource A_Color_DropShadow}" Margin="0,0,0,230" VerticalAlignment="Bottom" />
                    <local:FZTextBlock Text="{Binding EventProgress}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Subtitle}" Color="{StaticResource A_Color_Cutscene_Subtitle_Foreground}" VerticalAlignment="Bottom" Margin="-5,0,0,235" />
                </Grid>
                <local:FZTextBlock Text="{Binding EventType}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Title}" Color="{StaticResource A_Color_DropShadow}" Margin="0,0,0,0" VerticalAlignment="Bottom" />
                <local:FZTextBlock Text="{Binding EventType}" Style="{StaticResource A_Style_FZTextBlock_Cutscene_Title}" Color="{StaticResource A_Color_Cutscene_Title_Foreground}" Margin="-6,0,0,6" VerticalAlignment="Bottom" />
            </Grid>
        </ControlTemplate>

        <Storyboard x:Key="ShowStoryboard">
            <StringAnimationUsingKeyFrames Storyboard.TargetName="Section1EventFire" Storyboard.TargetProperty="(local:EventFire.EventName)">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="startoffevent" />
                <DiscreteStringKeyFrame KeyTime="0:0:0.5" Value="showevent" />
                <DiscreteStringKeyFrame KeyTime="0:0:3" Value="hideevent" />
            </StringAnimationUsingKeyFrames>

            <StringAnimationUsingKeyFrames Storyboard.TargetName="Section2EventFire" Storyboard.TargetProperty="(local:EventFire.EventName)">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="startoffevent" />
                <DiscreteStringKeyFrame KeyTime="0:0:3.5" Value="showevent" />
                <DiscreteStringKeyFrame KeyTime="0:0:6" Value="hideevent" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="HideStoryboard">
            <!--<StringAnimationUsingKeyFrames Storyboard.TargetName="Section1EventFire" Storyboard.TargetProperty="(local:EventFire.EventName)">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="startoffevent" />
            </StringAnimationUsingKeyFrames>

            <StringAnimationUsingKeyFrames Storyboard.TargetName="Section2EventFire" Storyboard.TargetProperty="(local:EventFire.EventName)">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="startoffevent" />
            </StringAnimationUsingKeyFrames>-->
        </Storyboard>

    </Page.Resources>

    <local:EventFire.FzTriggers>
        <local:EventFireTrigger Event="show" Storyboard="{StaticResource ShowStoryboard}" />
        <local:EventFireTrigger Event="hide" Storyboard="{StaticResource HideStoryboard}" />
    </local:EventFire.FzTriggers>

    <Grid>   
	    <Viewbox x:Name="PART_LayoutRoot" VerticalAlignment="Center" StretchDirection="DownOnly" HorizontalAlignment="Left">
            <Grid>
                
                <Grid ClipToBounds="True">
                    <ContentControl x:Name="Section1" Style="{StaticResource A_Style_PostRace_AnimatedControl}" Content="{StaticResource A_Template_Section1}" />
                    <local:EventFire x:Name="Section1EventFire" TargetName="Section1"/>
                </Grid>

                <Grid ClipToBounds="True">
                    <ContentControl x:Name="Section2" Style="{StaticResource A_Style_PostRace_AnimatedControl}" Content="{StaticResource A_Template_Section2}" />
                    <local:EventFire x:Name="Section2EventFire" TargetName="Section2"/>
                </Grid>
            </Grid>
        </Viewbox>

    </Grid>
</Page>