<Window x:Class="PlayBackDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        xmlns:DTControl="clr-namespace:DayTimePickControl" ResizeMode="CanMinimize"
        Title="{StaticResource ID_TITLE}" Height="600" Width="900" Loaded="Window_Loaded" Closing="Window_Closing">
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <StackPanel.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="Width" Value="auto"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="FontSize" Value="13"/>
                    <Setter Property="HorizontalAlignment" Value="Left"/>
                    <Setter Property="Margin" Value="10,0,2,0"/>
                </Style>
                <Style TargetType="TextBox">
                    <Setter Property="Width" Value="110"/>
                    <Setter Property="VerticalContentAlignment" Value="Center"/>
                    <Setter Property="FontSize" Value="13"/>
                    <Setter Property="HorizontalContentAlignment" Value="Left"/>
                    <Setter Property="Height" Value="30"/>
                </Style>
            </StackPanel.Resources>
            <TextBlock Text="{StaticResource ID_IP}"></TextBlock>
            <TextBox x:Name="ipInput">171.35.0.140</TextBox>
            <TextBlock Text="{StaticResource ID_PORT}"></TextBlock>
            <TextBox x:Name="portInput" PreviewTextInput="portInput_PreviewTextInput">37777</TextBox>
            <TextBlock Text="{StaticResource ID_USERNAME}"></TextBlock>
            <TextBox x:Name="userInput" >admin</TextBox>
            <TextBlock Text="{StaticResource ID_PASSWORD}"></TextBlock>
            <PasswordBox x:Name="passwordInput" 
                         Width="{Binding ElementName=userInput, Path=Width}"
                         VerticalContentAlignment="{Binding ElementName=userInput, Path=VerticalContentAlignment}"
                         FontSize="{Binding ElementName=userInput,Path=FontSize}"
                         HorizontalAlignment="{Binding ElementName=userInput,Path=HorizontalAlignment}"
                         Height="{Binding ElementName=userInput,Path=Height}"
                         Password="admin">
            </PasswordBox>
            <Separator Margin="12"></Separator>
            <Button x:Name="btnLogin" Width="80" Margin="12" Click="Login_Click" Content="{StaticResource ID_LOGIN}"></Button>
            <Button x:Name="btnLogout" Width="80" Margin="12" Click="Logout_Click" Content="{StaticResource ID_LOGOUT}" IsEnabled="False"></Button>
        </StackPanel>
        <Grid Grid.Row="1" x:Name="ControlPart" IsEnabled="False">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="6*"/>
                <ColumnDefinition Width="3*"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0" x:Name="LeftGrid">
                <Grid.RowDefinitions>
                    <RowDefinition Height="55*"/>
                    <RowDefinition Height="5*"/>
                    <RowDefinition Height="20*"/>
                </Grid.RowDefinitions>
                <WindowsFormsHost Grid.Row="0" Margin="5" Background="Gray">
                    <wf:PictureBox x:Name="playWindow"></wf:PictureBox>
                </WindowsFormsHost>
                <UniformGrid Columns="6" Grid.Row="1">
                    <Button x:Name="btnPause" Margin="5" Width="50" Content="{StaticResource ID_PAUSE}" Click="btnPause_Click"></Button>
                    <Button x:Name="btnPlay" Margin="5" Width="50" Content="{StaticResource ID_PLAY}" Click="btnPlay_Click"  Visibility="Collapsed"/>
                    <Button x:Name="btnStop" Margin="5" Width="50" Content="{StaticResource ID_STOP}" Click="btnStop_Click"></Button>
                    <Button x:Name="btnSlow" Margin="5" Width="50" Content="{StaticResource ID_SLOW}" Click="btnSlow_Click"></Button>
                    <TextBox x:Name="tbSpeed" IsEnabled="False" Width="50" Height="25" TextAlignment="Center" VerticalContentAlignment="Center" Text="1X" />
                    <Button x:Name="btnFast" Margin="5" Width="50" Content="{StaticResource ID_FAST}" Click="btnFast_Click"></Button>
                    <Button x:Name="btnNormal" Margin="5" Width="50" Content="{StaticResource ID_NORMAL}" Click="btnNormal_Click"></Button>
                </UniformGrid>
                <DTControl:DayTimePick x:Name="dayTimePicker" Grid.Row="2" Width="550" Height="100" Grid.RowSpan="2" OnTimeClick="dayTimePicker_OnTimeClick"></DTControl:DayTimePick>
            </Grid>
            <Frame x:Name="PlayBackFrame" Grid.Column="1" Background="AliceBlue" ></Frame>
            
        </Grid>
    </Grid>
</Window>