<phone:PhoneApplicationPage
    x:Class="mediastreamer2_tester_wp8.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="UnitTestItemTemplate">
            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" Text="{Binding Name}"/>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <phone:Pivot Title="MEDIASTREAMER2 TESTER" SelectionChanged="Pivot_SelectionChanged">
            <phone:PivotItem Header="Test Suite" x:Name="TestSuitePivot">
                <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                    <CheckBox x:Name="Verbose" Content="Verbose" HorizontalAlignment="Right" Margin="0,0,0,537" IsChecked="True"/>
                    <phone:LongListSelector x:Name="Tests" HorizontalAlignment="Left" Height="510" VerticalAlignment="Top" Width="456" ItemTemplate="{StaticResource UnitTestItemTemplate}" LayoutMode="List" Margin="0,70,0,-10" Tap="Tests_Tap"/>
                </Grid>
            </phone:PivotItem>
            <phone:PivotItem Header="Video" x:Name="VideoPivot">
                <Canvas>
                    <MediaElement Visibility="{Binding RemoteVideoVisibility}" MediaOpened="remoteVideo_MediaOpened_1" MediaFailed="remoteVideo_MediaFailed_1" x:Name="remoteVideo" Source="{Binding RemoteVideoUri}" Width="450" Height="600" RenderTransformOrigin="0.5,0.5" Canvas.Left="3" Stretch="UniformToFill" />
                    <Border Background="Black" Opacity="0.8" Padding="5" Canvas.Top="394" Width="160" Height="210" >
                        <MediaElement Visibility="{Binding LocalVideoVisibility}" MediaOpened="localVideo_MediaOpened_1" MediaFailed="localVideo_MediaFailed_1" x:Name="localVideo" Source="{Binding LocalVideoUri}" RenderTransformOrigin="0.5,0.5" Width="200" Height="150" Stretch="UniformToFill" UseLayoutRounding="False" d:LayoutRounding="Auto" Margin="-25,25">
                            <MediaElement.RenderTransform>
                                <CompositeTransform Rotation="-90"/>
                            </MediaElement.RenderTransform>
                        </MediaElement>
                    </Border>
                </Canvas>
            </phone:PivotItem>
        </phone:Pivot>

        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
    </Grid>

</phone:PhoneApplicationPage>