<UserControl x:Class="EMU7800.SL.View.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:ViewModel="clr-namespace:EMU7800.SL.ViewModel"
    xmlns:View="clr-namespace:EMU7800.SL.View"
    mc:Ignorable="d"
    d:DesignWidth="800"
    d:DesignHeight="600">
    <UserControl.Resources>
        <ViewModel:MainPageViewModel x:Key="viewModel"/>
        <Style TargetType="TextBlock">
            <Setter Property="Foreground" Value="White"/>
        </Style>
        <Style TargetType="Controls:Label">
            <Setter Property="Background" Value="Black"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Padding" Value="0,0,0,5"/>
        </Style>
        <Style TargetType="Border">
            <Setter Property="CornerRadius" Value="10"/>
            <Setter Property="Padding" Value="5,5,5,5"/>
            <Setter Property="Margin" Value="2"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush" Value="White"/>
            <Setter Property="Background" Value="Black"/>
        </Style>
        <Style TargetType="RadioButton">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="Black"/>
        </Style>
        <Style TargetType="ComboBox">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="Black"/>
        </Style>
        <Style TargetType="View:DownUpButton">
            <!--<Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="Black"/>-->
            <Setter Property="Margin" Value="5"/>
            <Setter Property="Padding" Value="5,0,5,0"/>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="gridLayoutRoot" DataContext="{Binding Source={StaticResource viewModel}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.Background>Black</Grid.Background>
        <Border x:Name="mediaplayerBorder">
            <MediaElement x:Name="mediaplayerScreen"  Grid.Row="0" Grid.Column="0"
                          Visibility="Visible" AutoPlay="True" Stretch="Fill" Opacity="1"
                          Volume="{Binding ElementName=nokeysliderVolume, Path=Value, Mode=TwoWay}" />
        </Border>
        <StackPanel x:Name="stackpanelControlPanel" Grid.Row="1" Grid.Column="0"
                    Orientation="Horizontal" Margin="5" HorizontalAlignment="Center">
            <Border x:Name="borderTvType">
                <StackPanel x:Name="stackpanelTvType">
                    <Controls:Label x:Name="labelTvType">T.V. Type</Controls:Label>
                    <RadioButton x:Name="radiobuttonTvTypeColor" GroupName="ColorBw" Content="Color" IsChecked="{Binding Path=IsColorSet, Mode=TwoWay}"/>
                    <RadioButton x:Name="radioButtonTvTypeBw" GroupName="ColorBw" Content="B/W" IsChecked="{Binding Path=IsBwSet, Mode=TwoWay}"/>
                </StackPanel>
            </Border>
            <Border x:Name="borderLeftDifficulty">
                <StackPanel x:Name="stackpanelLeftDifficulty">
                    <Controls:Label x:Name="labelLeftDifficulty">Left Difficulty</Controls:Label>
                    <RadioButton x:Name="radiobuttonLeftDifficultyA" GroupName="LeftDifficulty" Content="A (Pro)" IsChecked="{Binding Path=IsLeftDifficultySet, Mode=TwoWay}" />
                    <RadioButton x:Name="radiobuttonLeftDifficultyB" GroupName="LeftDifficulty" Content="B (Novice)" IsChecked="True" />
                </StackPanel>
            </Border>
            <Border x:Name="borderGameProgram">
                <StackPanel x:Name="stackpanelGameProgram">
                    <StackPanel x:Name="stackpanelGameProgram2" Orientation="Horizontal">
                        <Image Source="/EMUIcon.png" MaxWidth="16" MaxHeight="16" Margin="0,0,5,5"/>
                        <Controls:Label>EMU7800 SL - Mike Murphy</Controls:Label>
                    </StackPanel>
                    <ComboBox x:Name="comboboxGameProgram" Width="200" Height="30"
                              ItemsSource="{Binding Path=GameProgramCollection, Mode=OneWay}"
                              SelectedValue="{Binding Path=SelectedGameProgramId, Mode=TwoWay}"
                              DisplayMemberPath="Title"
                              SelectedValuePath="Id"
                              IsTabStop="False"
                              Foreground="Black" />
                </StackPanel>
            </Border>
            <Border x:Name="borderRightDifficulty">
                <StackPanel x:Name="stackpanelRightDifficulty" >
                    <Controls:Label x:Name="labelRightDifficulty">Right Difficulty</Controls:Label>
                    <RadioButton x:Name="radiobuttonRightDifficultyA" GroupName="RightDifficulty" Content="A (Pro)" IsChecked="{Binding Path=IsRightDifficultySet, Mode=TwoWay}" />
                    <RadioButton x:Name="radioButtonRightDifficultyB" GroupName="RightDifficulty" Content="B (Novice)" IsChecked="True" />
                </StackPanel>
            </Border>
            <Canvas x:Name="canvasBlend" Width="16">
                <TextBlock Text="- Blend +">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                            <RotateTransform Angle="-90"/>
                            <TranslateTransform X="3" Y="60" />
                        </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
            </Canvas>
            <View:NoKeySlider x:Name="nokeysliderBlend" Margin="2" Orientation="Vertical"
                        Minimum="0.1" Maximum="0.9" SmallChange="0.1"
                        Value="{Binding BlendFactor, Mode=TwoWay}"
                        IsTabStop="False" />
            <Canvas x:Name="canvasVolume" Width="16">
                <TextBlock Text="- Volume +">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                            <RotateTransform Angle="-90"/>
                            <TranslateTransform X="3" Y="65" />
                        </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
            </Canvas>
            <View:NoKeySlider x:Name="nokeysliderVolume" Margin="2" Orientation="Vertical"
                        Value="0.5" Minimum="0.0" Maximum="1.0" SmallChange="0.1"
                        IsTabStop="False" />
            <StackPanel x:Name="stackpanelButtons" Orientation="Vertical" VerticalAlignment="Center" >
                <View:DownUpButton x:Name="buttonSelect" Content="Game Select" Height="30" />
                <View:DownUpButton x:Name="buttonReset" Content="Game Reset" Height="30" />
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
