<Page xmlns:local="clr-namespace:ForzaUI;assembly="
      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_CinematicUIVideoPanel"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      mc:Ignorable="d"
      Style="{DynamicResource A_Style_Page_Generic}">

    <Page.Resources>
        <Storyboard x:Key="ShowStoryboard">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                           Storyboard.TargetName="LayoutRoot">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.0" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        
        <Storyboard x:Key="HideStoryboard">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                           Storyboard.TargetName="LayoutRoot">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.0" Value="{x:Static Visibility.Collapsed}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
    </Page.Resources>

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

    <Grid x:Name="LayoutRoot" Visibility="Visible">
        <Viewbox Stretch="Uniform">
            <MediaElement x:Name="Video" Style="{StaticResource A_Style_ScreenSize}" local:FzMediaElementExtension.Loop="True"/>
        </Viewbox>
    </Grid>
</Page>
