﻿<Page
    x:Class="File360.VideoPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:File360"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Page.Resources>
        <Storyboard x:Name="MenuHide">
            <DoubleAnimation Duration="0:0:0.2" To="-50" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid1" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid1" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="-40" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="toggleButton" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="40" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="toggleButton1" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid3" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.3" To="1.2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.3" To="1.2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.3" To="80" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.3" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.4" To="1.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="grid1" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.4" To="1.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="grid1" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
        </Storyboard>
        <Storyboard x:Name="MenuHideRev">
            <DoubleAnimation Duration="0:0:0.4" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid1" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid1">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="toggleButton">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="toggleButton1">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid3">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimation Duration="0:0:0.4" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.4" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.4" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="stackPanel">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimation Duration="0:0:0.4" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="grid1" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.4" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="grid1" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <QuarticEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
        </Storyboard>
    </Page.Resources>

    <Grid x:Name="MediaFragment" Grid.RowSpan="2" RequestedTheme="Dark"  RenderTransformOrigin="0,0">
        <Grid x:Name="imageContainerMedia" VerticalAlignment="Stretch">
            <Grid.Background>
                <SolidColorBrush Color="{ThemeResource PhoneBackgroundColor}"/>
            </Grid.Background>
            <Viewbox StretchDirection="Both" Stretch="Uniform">
                <MediaElement x:Name="mediaPlayer" AudioCategory="BackgroundCapableMedia" ManipulationStarted="mediaPlayer_ManipulationStarted" ManipulationDelta="mediaPlayer_ManipulationDelta" ManipulationCompleted="mediaPlayer_ManipulationCompleted"/>
            </Viewbox>
            <Grid VerticalAlignment="Stretch" Margin="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid x:Name="grid1" Opacity="1" RenderTransformOrigin="0.5,0.5">
                    <Grid.RenderTransform>
                        <CompositeTransform/>
                    </Grid.RenderTransform>
                    <Grid.Background>
                        <SolidColorBrush Color="{ThemeResource ContentDialogDimmingColor}"/>
                    </Grid.Background>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Grid MinWidth="50" MinHeight="0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Button >
                            <StackPanel Margin="10,0" Orientation="Horizontal">
                                <StackPanel VerticalAlignment="Center" CacheMode="BitmapCache" x:Name="grid" Grid.Column="1" Margin="0">
                                    <TextBlock x:Name="videoName" Text="no media" TextWrapping="NoWrap" MinWidth="175" FontSize="18.667" VerticalAlignment="Center" FontFamily="Assets/Font/Custom/Raleway-Light.ttf#Raleway" Margin="0" HorizontalAlignment="Left" Foreground="White"/>
                                    <TextBlock Text="{Binding Text, ElementName=mediaDuration}" FontSize="13.333" VerticalAlignment="Center" Margin="0" FontFamily="Assets/Font/Custom/ClearSans-Thin.ttf#Clear Sans Thin" HorizontalAlignment="Left" Foreground="White"/>
                                </StackPanel>
                            </StackPanel>
                        </Button>
                    </Grid>
                    <Button x:Name="button2" Grid.Column="1" MinWidth="0" Visibility="Collapsed"  Content="c"  FontFamily="Assets/Font/iconfont.ttf#iconfont"/>
                </Grid>
                <Grid RequestedTheme="Dark" x:Name="grid2" Grid.Row="1" Visibility="Visible" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid Tapped="Grid_Tapped">
                        <TextBlock x:Name="vidoeStats" Text="" FontSize="150" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Assets/Font/iconfont.ttf#iconfont" />
                        <Rectangle x:Name="rectangle">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.7">
                                    <GradientStop Color="Black" Offset="0"/>
                                    <GradientStop Color="Black" Offset="1"/>
                                    <GradientStop Offset="0.5"/>
                                    <GradientStop Offset="0.05" Color="{ThemeResource ContentDialogDimmingColor}"/>
                                    <GradientStop Offset="0.95" Color="{ThemeResource ContentDialogDimmingColor}"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Border Grid.Column="1" x:Name="border" VerticalAlignment="Center" RenderTransformOrigin="0.5,1">
                            <Border.RenderTransform>
                                <CompositeTransform ScaleY="0"/>
                            </Border.RenderTransform>
                            <Border.Background>
                                <SolidColorBrush Color="{ThemeResource ContentDialogDimmingColor}" Opacity="0.98"/>
                            </Border.Background>
                            <TextBlock  x:Name="sliderTimer" Margin="30" Text="{Binding Text, ElementName=currentDuration}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="30">
                                <TextBlock.Foreground>
                                    <SolidColorBrush Color="{ThemeResource PhoneForegroundColor}"/>
                                </TextBlock.Foreground>
                            </TextBlock>
                        </Border>
                    </Grid>
                    <Grid x:Name="grid3" VerticalAlignment="Bottom">
                        <ToggleButton x:Name="toggleButton" MinWidth="50" Content="X" FontFamily="Assets/Font/iconfont.ttf#iconfont" Style="{StaticResource ToggleButtonStyle}" VerticalAlignment="Bottom" Margin="10,0,0,25" RenderTransformOrigin="0.5,0.5">
                            <ToggleButton.RenderTransform>
                                <CompositeTransform/>
                            </ToggleButton.RenderTransform>
                        </ToggleButton>

                        <ToggleButton x:Name="toggleButton1" Content="C" MinWidth="50" FontFamily="Assets/Font/iconfont.ttf#iconfont" Style="{StaticResource ToggleButtonStyle}" Margin="0,0,10,25" HorizontalAlignment="Right" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                            <ToggleButton.RenderTransform>
                                <CompositeTransform/>
                            </ToggleButton.RenderTransform>
                        </ToggleButton>
                    </Grid>

                    <Grid Grid.Row="1" VerticalAlignment="Center">
                        <StackPanel x:Name="stackPanel" RenderTransformOrigin="0.5,0.5">
                            <StackPanel.RenderTransform>
                                <CompositeTransform/>
                            </StackPanel.RenderTransform>
                            <Grid>
                                <Grid.Background>
                                    <SolidColorBrush Color="{ThemeResource ContentDialogDimmingColor}"/>
                                </Grid.Background>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ProgressBar Value="0" Margin="10" x:Name="musicSlider" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="5"/>

                                <TextBlock x:Name="currentDuration"  Grid.Row="1" Text="--:--" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,5,0,5"/>
                                <TextBlock x:Name="mediaDuration" Text="--:--" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,5,10,5"/>
                            </Grid>
                            <Grid>
                                <Grid.Background>
                                    <SolidColorBrush Color="{ThemeResource ContentDialogDimmingColor}"/>
                                </Grid.Background>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Button  Content="6"  FontFamily="Assets/Font/iconfont.ttf#iconfont" FontSize="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                                    <Button x:Name="playPause" Grid.Column="1" Content="8" FontFamily="Assets/Font/iconfont.ttf#iconfont"  Click="PlayCurrent" FontSize="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                                    <Button Content="4" Grid.Column="2"  FontFamily="Assets/Font/iconfont.ttf#iconfont" FontSize="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                                </Grid>
                            </Grid>
                        </StackPanel>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</Page>
