<Window x:Class="Basic_CameraViewer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="550" Width="550" 
        ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
    <Grid>
        <GroupBox Header="Connect to USB camera" Height="100" Width="150"
                  HorizontalAlignment="Left" VerticalAlignment="Top">
            <Grid>
                <Button Content="Connect" Width="75" Margin="32,19,0,0" 
                        HorizontalAlignment="Left" VerticalAlignment="Top"
                        Click="ConnectUSBCamera_Click"/>
                <Button Content="Disconnect" Width="75" Margin="32,46,0,0"
                        HorizontalAlignment="Left" VerticalAlignment="Top"
                        Click="DisconnectUSBCamera_Click"/>
            </Grid>
        </GroupBox>

        <GroupBox Header="Connect to IP camera" Height="100" Width="387" 
                  HorizontalAlignment="Left" VerticalAlignment="Top" Margin="155,0,0,0">
            <Grid>
                <Label Height="25" Width="70" Content="Host" 
                       HorizontalAlignment="Left" VerticalAlignment="Top"/>
                <TextBox Name="HostTextBox" HorizontalAlignment="Left" VerticalAlignment="Top"
                         Height="23" Width="169" Margin="68,2,0,0" TextWrapping="Wrap" />
                <Label Height="25" Width="70" Content="Username" 
                       HorizontalAlignment="Left" Margin="0,26,0,0" VerticalAlignment="Top"/>
                <TextBox Name="UserTextBox" HorizontalAlignment="Left" VerticalAlignment="Top" 
                         Height="23" Width="169" Margin="68,29,0,0" TextWrapping="Wrap"/>
                <Label Height="25" Width="70" Content="Password" 
                       HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,52,0,0" />
                <PasswordBox Name="Password" HorizontalAlignment="Left" VerticalAlignment="Top"
                             Height="25" Width="169" Margin="68,56,0,0"/>
                <Button Content="Connect" HorizontalAlignment="Left" VerticalAlignment="Top"
                        Margin="267,16,0,0"  Width="75" Click="ConnectIPCamera_Click"/>
                <Button Content="Disconnect" HorizontalAlignment="Left" VerticalAlignment="Top"
                        Margin="267,43,0,0"  Width="75" Click="DisconnectIPCamera_Click" />
            </Grid>
        </GroupBox>

        <Grid Name="CameraBox" Margin="10,105,10,166"/>

        <GroupBox Header="Function" Height="160" Width="542" Margin="0,360,0,0"
                  HorizontalAlignment="Left" VerticalAlignment="Top" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <ListBox Grid.Column="1" Name="ConnectedClientList"/>
                <GroupBox Grid.Column="0" Header="Set Listen Address">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="3*"/>
                            </Grid.ColumnDefinitions>
                            <Label Grid.Column="0" Content="Address"/>
                            <TextBox Grid.Column="1" Height="25" Name="IpAddressText"/>
                        </Grid>
                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="3*"/>
                            </Grid.ColumnDefinitions>
                            <Label Grid.Column="0" Content="Port"/>
                            <TextBox Grid.Column="1" Height="25" Name="PortText"/>
                        </Grid>
                        <Grid Grid.Row="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" Content="Start" 
                                    HorizontalAlignment="Center" VerticalAlignment="Center" 
                                    Width="75" Click="StartServer_Click"/>
                            <Button Grid.Column="1" Content="Stop" 
                                    HorizontalAlignment="Center" VerticalAlignment="Center" 
                                    Width="75" Click="StopServer_Click" />
                        </Grid>
                    </Grid>
                </GroupBox>
            </Grid>
        </GroupBox>
    </Grid>
</Window>
