<UserControl x:Class="TrailerPlayer.TrailerControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
             xmlns:mp="clr-namespace:TrailerPlayer" Width="350" Background="Black">
    <UserControl.Resources>
        <Storyboard x:Name="mediaplayer_in">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="MediaPlayer" Storyboard.TargetProperty="(Canvas.Left)">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="mediaplayer_out">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="MediaPlayer" Storyboard.TargetProperty="(Canvas.Left)">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="350"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="description_in">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="Description" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="description_out">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="Description" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="selected">
            <!--btnTrailer megjelenítése-->
            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="btnTrailer" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="btnTrailer" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <!--btnDescription megjelenítése-->
            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="btnDescription" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="btnDescription" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="unselected">
            <!--btnTrailer megjelenítése-->
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:0.3" Duration="0" Storyboard.TargetName="btnTrailer" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="btnTrailer" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <!--btnDescription megjelenítése-->
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:0.3" Duration="0" Storyboard.TargetName="btnDescription" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="btnDescription" Storyboard.TargetProperty="Opacity">
                <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <Canvas Width="700" x:Name="ViewWindow" Background="Black" >

        <Grid Canvas.Left="1" x:Name="DataView" Background="Black" >
            <Grid.RowDefinitions>
                <RowDefinition Height="60"/>
                <RowDefinition Height="60"/>
                <RowDefinition Height="90"/>
                <RowDefinition Height="60"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Row="0">
                <TextBlock  Text="{Binding Path=Title}" Margin="0,3" FontSize="12" FontWeight="Bold" TextWrapping="Wrap" Style="{StaticResource TextBlockStyle}"/>
            </StackPanel>

            <StackPanel Grid.Row="1">
                <TextBlock  Text="Director: " TextWrapping="Wrap" FontWeight="Bold" Margin="0,2" Style="{StaticResource TextBlockStyle}"/>
                <TextBlock  Text="{Binding Path=Director}" TextWrapping="Wrap" Style="{StaticResource TextBlockStyle}"/>
            </StackPanel>

            <StackPanel Grid.Row="2">
                <TextBlock  Text="Cast:" TextWrapping="Wrap" FontWeight="Bold" Margin="0,2" Style="{StaticResource TextBlockStyle}"/>
                <TextBlock  Text="{Binding Path=Cast}" TextWrapping="Wrap" Style="{StaticResource TextBlockStyle}"/>
            </StackPanel>

            <StackPanel Grid.Row="3">
                <TextBlock  Text="Genre:"  FontWeight="Bold" TextWrapping="Wrap" Margin="0,2" Style="{StaticResource TextBlockStyle}"/>
                <TextBlock  Text="{Binding Path=Type}" TextWrapping="Wrap" Style="{StaticResource TextBlockStyle}"/>
            </StackPanel>
           
            <Image Grid.Column="1" Grid.RowSpan="4" Source="{Binding Path=Picture}"/>
            <ToggleButton Visibility="Collapsed" Margin="0,5" x:Name="btnTrailer" Click="btnTrailer_Click" Grid.Row="4" Content="Watch HD Trailer" HorizontalAlignment="Left"  IsChecked="False" />
            <ToggleButton Visibility="Collapsed" Margin="0,5" x:Name="btnDescription" Click="btnDescription_Click" Grid.Row="4"  Grid.Column="1"  Content="View Descripton" HorizontalAlignment="Right"  IsChecked="False"/>
            <ScrollViewer x:Name="Description" MaxHeight="200" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="5" Grid.ColumnSpan="2" Opacity="0">
                <TextBlock  Text="{Binding Path=Description}" TextWrapping="Wrap"  Style="{StaticResource TextBlockStyle}"/>
            </ScrollViewer>
        </Grid>

        <mp:MediaPlayer x:Name="MediaPlayer" Canvas.Left="350" Source="{Binding Path=Source}" ThumbImage="{Binding Path=Thumb}"/>
        <Rectangle x:Name="Mask" Width="350" Height="270" Fill="#FF000000" Stroke="#FF000000" Canvas.Top="0" Canvas.Left="350"/>

    </Canvas>
</UserControl>
