<UserControl
    x:Class="JumpPoint.Uwp.Controls.VideoPropertiesControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:JumpPoint.Uwp.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:ngconv="using:NittyGritty.Uwp.Converters"
             xmlns:helper="using:JumpPoint.ViewModels.Helpers"
             xmlns:sys="using:System"
             mc:Ignorable="d"
    d:DesignHeight="1200"
    d:DesignWidth="400">

    <UserControl.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="TextWrapping"
                    Value="WrapWholeWords" />
        </Style>
    </UserControl.Resources>

    <Grid ColumnSpacing="8"
          RowSpacing="4">
        <Grid.Resources>
            <ngconv:StringInterpolationConverter x:Name="AspectRatioConverter"
                                                 Format="{}{0}:{1}">
                <ngconv:Binding Value="{x:Bind Video.HorizontalAspectRatio, Mode=OneWay}" />
                <ngconv:Binding Value="{x:Bind Video.VerticalAspectRatio, Mode=OneWay}" />
            </ngconv:StringInterpolationConverter>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBlock Text="Data Rate:" />
        <TextBlock Text="{x:Bind helper:PropertyHelper.ConvertToKilo(Video.DataRate, 'kbps'), Mode=OneWay}"
                   Grid.Column="1" />

        <TextBlock Text="Compression:"
                   Grid.Row="1" />
        <TextBlock Text="{x:Bind Video.Compression, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="1" />

        <TextBlock Text="Directors:"
                   Grid.Row="2" />
        <TextBlock Text="{x:Bind sys:String.Join('; ', Video.Directors), Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="2" />

        <TextBlock Text="Frame Rate:"
                   Grid.Row="3" />
        <TextBlock Text="{x:Bind helper:PropertyHelper.ConvertToKilo(Video.FrameRate, 'fps'), Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="3" />

        <TextBlock Text="Frame Width:"
                   Grid.Row="4" />
        <TextBlock Text="{x:Bind Video.FrameWidth, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="4" />

        <TextBlock Text="Frame Height:"
                   Grid.Row="5" />
        <TextBlock Text="{x:Bind Video.FrameHeight, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="5" />

        <TextBlock Text="Aspect Ratio:"
                   Grid.Row="6" />
        <TextBlock Text="{x:Bind AspectRatioConverter.Output, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="6" />

        <TextBlock Text="Orientation:"
                   Grid.Row="7" />
        <TextBlock Text="{x:Bind Video.Orientation, Converter={StaticResource HumanizerConverter}, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="7" />

        <TextBlock Text="Sample Size:"
                   Grid.Row="8" />
        <TextBlock Text="{x:Bind Video.SampleSize, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="8" />

        <TextBlock Text="Total Bitrate:"
                   Grid.Row="9" />
        <TextBlock Text="{x:Bind helper:PropertyHelper.ConvertToKilo(Video.TotalBitrate, 'kbps'), Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="9" />

        <MenuFlyoutSeparator Grid.Row="10"
                             Grid.ColumnSpan="2" />

        <TextBlock Text="4CC:"
                   Grid.Row="11" />
        <TextBlock Text="{x:Bind Video.FourCC, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="11" />

        <TextBlock Text="Is Spherical:"
                   Grid.Row="12" />
        <TextBlock Text="{x:Bind Video.IsSpherical, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="12" />

        <TextBlock Text="Is Stereo:"
                   Grid.Row="13" />
        <TextBlock Text="{x:Bind Video.IsStereo, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="13" />

        <TextBlock Text="Stream Name:"
                   Grid.Row="14" />
        <TextBlock Text="{x:Bind Video.StreamName, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="14" />

        <TextBlock Text="Stream Number:"
                   Grid.Row="15" />
        <TextBlock Text="{x:Bind Video.StreamNumber, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="15" />

        <TextBlock Text="Transcoded for Sync:"
                   Grid.Row="16" />
        <TextBlock Text="{x:Bind Video.TranscodedForSync, Mode=OneWay}"
                   Grid.Column="1"
                   Grid.Row="16" />

    </Grid>
</UserControl>
