<Window x:Class="CapturePreviewCSharp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:i="clr-namespace:System.Windows.Interop;assembly=PresentationCore"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:CapturePreviewCSharp"
        mc:Ignorable="d"
        Title="Capture Preview" Height="475" Width="1156" Loaded="Window_Loaded" Closing="Window_Closing">
    <DockPanel LastChildFill="True">
        <Grid DockPanel.Dock="Left" Width="360" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <GroupBox x:Name="groupBoxProperties" Header="Properties" >
                <Grid HorizontalAlignment="Left" Margin="5" Width="340">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Label x:Name="labelDevice" Content="Input Device:" Margin="3"/>
                    <ComboBox x:Name="comboBoxDevice" Grid.Column="1" Margin="3" SelectionChanged="comboBoxDevice_SelectionChanged"/>
                    <Label x:Name="labelConnection" Content="Input Connection:" Grid.Row="1" Margin="3"/>
                    <ComboBox x:Name="comboBoxConnection" Grid.Row ="1" Grid.Column="1" Margin="3" SelectionChanged="comboBoxConnection_SelectionChanged"/>
                    <Label x:Name="labelFormat" Content="Video Format:" Grid.Row="2" Margin="3"/>
                    <ComboBox x:Name="comboBoxVideoFormat" Grid.Row ="2" Grid.Column="1" Margin="3" SelectionChanged="comboBoxVideoFormat_SelectionChanged"/>
                    <Label x:Name="labelAutoDetect" Content="Auto-Detect Format:" Grid.Row="3" Margin="3" Visibility="Collapsed"/>
                    <CheckBox x:Name="checkBoxAutoDetect" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" Checked="checkBoxAutoDetect_CheckedChanged" Unchecked="checkBoxAutoDetect_CheckedChanged" Visibility="Collapsed" IsThreeState="False"/>
                    <Label x:Name="label3DPreview" Content="3D Preview Format:" Grid.Row="4" Margin="3" Visibility="Collapsed"/>
                    <ComboBox x:Name="comboBox3DPreviewFormat" Grid.Row ="4" Grid.Column="1" Margin="3" Visibility="Collapsed"/>
                </Grid>
            </GroupBox>
            <GroupBox x:Name="groupBoxTimecode" Header="Timecode" Grid.Row="1">
                <DataGrid Name="dataGridTimecode" ItemsSource="{Binding TimecodeData}" AutoGenerateColumns="False" GridLinesVisibility="None" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HeadersVisibility="Column" Background="Transparent" RowBackground="Transparent" CanUserAddRows="False">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Format" Binding="{Binding Format}" Width="125" />
                        <DataGridTextColumn Header="Value" Binding="{Binding Value}" Width="125" />
                        <DataGridTextColumn Header="User Bits" Binding="{Binding UserBits}" Width="*" />
                    </DataGrid.Columns>
                </DataGrid>
            </GroupBox>
            <GroupBox x:Name="groupBoxVANC" Header="VANC" Grid.Row="2">
                <DataGrid Name="dataGridVANC" ItemsSource="{Binding VANCPacketData}" AutoGenerateColumns="False" GridLinesVisibility="None" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" HeadersVisibility="Column" Background="Transparent" RowBackground="Transparent" CanUserAddRows="False">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Line" Binding="{Binding Line}" Width="40" />
                        <DataGridTextColumn Header="DID" Binding="{Binding DID}" Width="40" />
                        <DataGridTextColumn Header="SDID" Binding="{Binding SDID}" Width="40" />
                        <DataGridTextColumn Header="Data" Binding="{Binding Data}" Width="Auto" MinWidth="226" />
                    </DataGrid.Columns>
                </DataGrid>
            </GroupBox>
            <GroupBox x:Name="groupBoxMetadata" Header="Static Metadata" Grid.Row="3">
                <DataGrid Name="dataGridMetadata" ItemsSource="{Binding MetadataData}" AutoGenerateColumns="False" GridLinesVisibility="None" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HeadersVisibility="Column" Background="Transparent" RowBackground="Transparent" CanUserAddRows="False">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Item" Binding="{Binding Item}" Width="250" />
                        <DataGridTextColumn Header="Value" Binding="{Binding Value}" Width="*" />
                    </DataGrid.Columns>
                </DataGrid>
            </GroupBox>
        </Grid>
        <GroupBox x:Name="groupBoxPreview" Header="Preview" >
            <Grid x:Name="gridPreview" Margin="5">
                <Image x:Name="imagePreview">
                    <Image.Source>
                        <i:D3DImage x:Name="d3dPreview" />
                    </Image.Source>
                </Image>
            </Grid>
        </GroupBox>
    </DockPanel>
</Window>
