<UserControl
    x:Class="MediaCaptureComp.MediaCapturer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MediaCaptureComp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400" VerticalContentAlignment="Top" HorizontalAlignment="Left">

    <Grid x:ConnectionId='2' x:Name="CaptureGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Visible" x:Load="True" ScrollViewer.IsVerticalScrollChainingEnabled="False">
        <Grid.Background>
            <ImageBrush Stretch="Uniform" ImageSource="/MediaCaptureComp/NoCam.png" Opacity="0.8">
                <ImageBrush.RelativeTransform>
                    <CompositeTransform CenterY="0.5" CenterX="0.5" ScaleX="0.5" ScaleY="0.5"/>
                </ImageBrush.RelativeTransform>
            </ImageBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="8*"/>
            <RowDefinition Height="0*"/>
        </Grid.RowDefinitions>

        <CaptureElement x:ConnectionId='3' x:Name="CaptureElmnt" FlowDirection="LeftToRight" Stretch="Uniform" x:Load="True" ManipulationMode="All" Canvas.ZIndex="1" Grid.Column="0" Grid.RowSpan="1" Grid.ColumnSpan="1">
        </CaptureElement>
        <StackPanel Height="Auto" Grid.Row="0"  Canvas.ZIndex="10" HorizontalAlignment="Right" VerticalAlignment="Bottom">
            <Grid HorizontalAlignment="Right" VerticalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Button x:ConnectionId='11' x:Name="btnPhotoCap" Grid.Column="0" ToolTipService.ToolTip="Take a photo" Width="35" Height="35" Visibility="Visible"                           x:Load="True" Canvas.ZIndex="10" VerticalAlignment="Stretch" Padding="0,0,0,0" CornerRadius="3,3,3,3" HorizontalAlignment="Right" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="1,1,1,1"                                                                      >
                    <Image x:ConnectionId='16' x:Name="imgPhoto" Source="/MediaCaptureComp/TakeImage.png" Width="25" Height="25" HorizontalAlignment="Center" VerticalAlignment="Center" Scale="25,25,25"/>
                </Button>
                <Button x:ConnectionId='12' x:Name="btnVideoCap" Grid.Column="2" ToolTipService.ToolTip="Start video recording"  Width="35" Height="35" Visibility="Visible"                           x:Load="True" Canvas.ZIndex="11" VerticalAlignment="Stretch" Padding="1,1,1,1" CornerRadius="3,3,3,3" HorizontalAlignment="Right" Margin="1,1,1,1"                                                                      >
                    <Image x:ConnectionId='15' x:Name="imgVideoStart" Source="/MediaCaptureComp/StartRecord.png" Width="25" Height="25" HorizontalAlignment="Center" VerticalAlignment="Center" Scale="25,25,25"/>
                </Button>
                <Button x:ConnectionId='13' x:Name="btnVideoCap_stop" ToolTipService.ToolTip="Stop video recording"  Width="35" Height="35" Visibility="Collapsed"                           x:Load="True" Canvas.ZIndex="10" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2,0,2,0" Padding="1,1,1,1" CornerRadius="3,3,3,3" Grid.Column="2"                                                                      >
                    <Image x:ConnectionId='14' x:Name="imgVideoStop" Source="/MediaCaptureComp/StopRecord.png" Width="25" Height="25" HorizontalAlignment="Center" VerticalAlignment="Center" Scale="25,25,25"></Image>
                </Button>
            </Grid>
        </StackPanel>

        <ComboBox x:ConnectionId='4' x:Name="lstDevices" ToolTipService.ToolTip="Select input device" VerticalAlignment="Top"                                                DisplayMemberPath="Name" Grid.Column="0" SelectedValuePath="Id" Canvas.ZIndex="10"/>

        <GridView x:ConnectionId='5' x:Name="grdPreview" IsItemClickEnabled="False" FlowDirection="LeftToRight" VerticalAlignment="Stretch"                                   Canvas.ZIndex="11" Visibility="Collapsed" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" Padding="2,2,2,2" Grid.Row="1">
        </GridView>

        <StackPanel x:ConnectionId='6' x:Name="stkCollapseExpand" Orientation="Horizontal" Canvas.ZIndex="11" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
            <Button x:ConnectionId='7' x:Name="btnCollapse" ToolTipService.ToolTip="Collapse" Height="35" Visibility="Collapsed" Canvas.ZIndex="10"                          Width="35" Grid.Row="1" Margin="4,0,0,0" Padding="1,1,1,1" CornerRadius="3,3,3,3"                                                                      >
                <Image x:ConnectionId='10' x:Name="imgPreviewCollapse" Canvas.ZIndex="11" Source="/MediaCaptureComp/PreviewCollapse.png" Scale="25,25,25" Width="25" HorizontalAlignment="Center" VerticalAlignment="Center" Height="25"/>
            </Button>
            <Button x:ConnectionId='8' x:Name="btnExpand" ToolTipService.ToolTip="Expand" Height="35" Visibility="Visible" Canvas.ZIndex="10"                          Width="35" Padding="1,1,1,1" CornerRadius="3,3,3,3" Margin="1,1,1,1"                                                                      >
                <Image x:ConnectionId='9' x:Name="imgPreviewExpand" Canvas.ZIndex="11" Source="/MediaCaptureComp/PreviewExpand.png" Scale="25,25,25" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Button>
        </StackPanel>
    </Grid>
</UserControl>

