<Window x:Class="PlayBackAndDownLoadDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:host="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" 
        xmlns:winform="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        Title="{StaticResource ID_TITLE}" Height="600" Width="900" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="60" />
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="240" />
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0" Grid.ColumnSpan="2">
            <GroupBox Header="{StaticResource ID_DEV_LOGIN}" Margin="1">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="140" />
                        <ColumnDefinition Width="130" />
                        <ColumnDefinition Width="180" />
                        <ColumnDefinition Width="180" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_IP}" VerticalAlignment="Center" Margin="3,0,0,0"/>
                            <TextBox x:Name="ip_textbox" Text="171.35.10.101" Width="120" Height="25" Margin="2,0,0,0"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="1">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_PORT}" VerticalAlignment="Center" />
                            <TextBox x:Name="port_textbox" Text="37777" Width="80" Height="25" Margin="2,0,0,0" PreviewTextInput="Port_TextInput"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="2">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_USERNAME}" VerticalAlignment="Center"/>
                            <TextBox x:Name="username_textbox" Text="admin" Width="120" Height="25" Margin="2,0,0,0"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="3">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_PASSWORD}" VerticalAlignment="Center"/>
                            <PasswordBox x:Name="password_textbox" Password="admin" Width="120" Height="25" Margin="2,0,0,0"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="4">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <Button x:Name="login_btn" Content="{StaticResource ID_LOGIN}" Width="100" Height="30" Margin="5,0,0,0" Click="login_btn_Click"/>
                            <Button x:Name="logout_btn" Content="{StaticResource ID_LOGOUT}" Width="100" Height="30" Margin="10,0,0,0" Click="logout_btn_Click"/>
                        </StackPanel>
                    </Grid>
                </Grid>
            </GroupBox>    
        </Grid>
            
        <Grid Grid.Row="1">
            <Border BorderBrush="Gray" BorderThickness="1" Margin="2,2,2,0" Background="LightSkyBlue">
                <host:WindowsFormsHost >
                    <winform:PictureBox x:Name="picBox"/>
                </host:WindowsFormsHost>
            </Border>
        </Grid>
        <Grid Grid.Row="2">
            <Border BorderBrush="Gray" Margin="2,1" BorderThickness="1">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <TextBlock x:Name="speed_tb" Width="40" Margin="5,0" VerticalAlignment="Center" TextAlignment="Center"/>
                    <Button x:Name="pause_bt" Content="{StaticResource ID_PASUSE}" Width="80" Height="30" Margin="20,0" Click="pause_bt_Click"/>
                    <Button x:Name="play_bt" Content="{StaticResource ID_PLAY}" Width="80" Height="30" Margin="20,0" Visibility="Collapsed" Click="play_bt_Click"/>
                    <Button x:Name="stop_bt" Content="{StaticResource ID_STOP}" Width="80" Height="30" Margin="20,0" Click="stop_bt_Click"/>
                    <Button x:Name="slow_bt" Content="{StaticResource ID_SLOW}" Width="80" Height="30" Margin="20,0" Click="slow_bt_Click"/>
                    <Button x:Name="fast_bt" Content="{StaticResource ID_FAST}" Width="80" Height="30" Margin="20,0" Click="fast_bt_Click"/>
                    <Button x:Name="normal_bt" Content="{StaticResource ID_NORMAL}" Width="80" Height="30" Margin="20,0" Click="normal_bt_Click"/>
                </StackPanel>
            </Border>
        </Grid>
        <Grid Grid.Row="1" Grid.RowSpan="2" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="5.5*"/>
                <RowDefinition Height="4.5*"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <GroupBox Header="{StaticResource ID_PLAYBACK}" Grid.Row="0">
                    <StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,10">
                            <TextBlock  Text="{StaticResource ID_CHANNEL}" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <ComboBox x:Name="playback_channel_combox" Margin="3,0,0,0" Width="150" HorizontalContentAlignment="Right"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,10">
                            <TextBlock  Text="{StaticResource ID_RECORDTYPE}" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <ComboBox x:Name="playback_type_combox" Margin="3,0,0,0" Width="150" HorizontalContentAlignment="Right"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,10">
                            <TextBlock  Text="{StaticResource ID_STREAMTYPE}" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <ComboBox x:Name="playback_streamtype_combox" Margin="3,0,0,0" Width="150" HorizontalContentAlignment="Right"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,10">
                            <TextBlock  Text="{StaticResource ID_STARTTIME}" Margin="0,0,3,0" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <WindowsFormsHost>
                                <winform:DateTimePicker x:Name="playback_starttime_dp"  Format="Custom" CustomFormat="yyyy-MM-dd HH:mm:ss" ShowUpDown="True" Width="150" />
                            </WindowsFormsHost>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,10">
                            <TextBlock  Text="{StaticResource ID_ENDTIME}" Margin="0,0,3,0" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <WindowsFormsHost>
                                <winform:DateTimePicker x:Name="playback_endtime_dp"  Format="Custom" CustomFormat="yyyy-MM-dd HH:mm:ss" ShowUpDown="True" Width="150" />
                            </WindowsFormsHost>
                        </StackPanel>
                        <Button x:Name="playback_bt" Width="160" Height="30" Margin="3,10" Content="{StaticResource ID_PLAY}" Click="playback_bt_Click"/>
                    </StackPanel>
                </GroupBox>
            </Grid>
            <Grid Grid.Row="1">
                <GroupBox Header="{StaticResource ID_DOWNLOAD}">
                    <StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,5">
                            <TextBlock  Text="{StaticResource ID_CHANNEL}" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <ComboBox x:Name="download_channel_combox" Margin="3,0,0,0" Width="150" HorizontalContentAlignment="Right"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,5">
                            <TextBlock  Text="{StaticResource ID_STREAMTYPE}" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <ComboBox x:Name="download_streamtype_combox" Margin="3,0,0,0" Width="150" HorizontalContentAlignment="Right"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,5">
                            <TextBlock  Text="{StaticResource ID_STARTTIME}" Margin="0,0,3,0" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <WindowsFormsHost>
                                <winform:DateTimePicker x:Name="download_starttime_dp"  Format="Custom" CustomFormat="yyyy-MM-dd HH:mm:ss" ShowUpDown="True" Width="150" />
                            </WindowsFormsHost>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="3,5">
                            <TextBlock  Text="{StaticResource ID_ENDTIME}" Margin="0,0,3,0" Width="60" TextAlignment="Right" VerticalAlignment="Center">:</TextBlock>
                            <WindowsFormsHost>
                                <winform:DateTimePicker x:Name="download_endtime_dp"  Format="Custom" CustomFormat="yyyy-MM-dd HH:mm:ss" ShowUpDown="True" Width="150" />
                            </WindowsFormsHost>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <Button x:Name="downlaodstart_bt" Width="80" Height="30" Margin="10,5" Content="{StaticResource ID_DOWNLOAD}" Click="downlaodstart_bt_Click"/>
                            <Button x:Name="downlaodstop_bt" Width="80" Height="30" Margin="10,5" Content="{StaticResource ID_STOP}" Click="downlaodstop_bt_Click"/>
                        </StackPanel>
                        <ProgressBar x:Name="download_processBar" MinHeight="10" Margin="3,20" />
                    </StackPanel>
                </GroupBox>
            </Grid>
        </Grid>
    </Grid>
</Window>
