<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SampleManualCheck_VB"
        mc:Ignorable="d" Loaded="Window_Loaded" Closing="Window_Closing"
        Title="SampleCode_iIDrl_SPC_WPF - ManualCheck" Height="450" Width="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="85" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!-- Row 0 - Port Controls-->
        <TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Text="COM-Port :" Margin="0,8,5,5" />
        <ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" Name="comboBox_PortSelect" Margin="5,5,20,5" />
        <Grid Grid.Row="0" Grid.Column="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" Name="button_OpenPort" Content="OPEN PORT" Margin="0,2,20,2" Click="Button_OpenPort_ClickAsync" />
            <Button Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Name="button_ClosePort" Content="CLOSE PORT" Margin="0,2,20,2" Click="Button_ClosePort_Click" />
        </Grid>
        <!--Row 1-->
        <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Receive:" />
        <Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button Grid.Column="0" Name="button_GetLastHeartbeat" Content="Last Heartbeat" Click="Button_GetLastHeartbeat_Click" IsEnabled="False" />
            <Button Grid.Column="1" Name="button_GetLastRawData" Content="Last RawData" Click="Button_GetLastRawData_Click" IsEnabled="False" />
            <Button Grid.Column="2" Name="button_GetHeartbeatAsync" Content="Get Heartbeat Async" Click="Button_GetHeartbeatAsync_ClickAsync" IsEnabled="False" />
            <Button Grid.Column="3" Name="button_GetRawDataAsync" Content="Get RawData Async" Click="Button_GetRawDataAsync_ClickAsync" IsEnabled="False" />
        </Grid>
        <!--Row 2-->
        <TextBlock  Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="TID Text :" Margin="30,5,0,5" FontSize="13" />
        <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"  HorizontalAlignment="Stretch" VerticalAlignment="Center" Name="textBox_Label" Margin="100,2,100,2" Height="22" TextAlignment="Center" FontSize="13" />
        <!--Row 3-->
        <TextBlock  Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Text="Data Read : " Margin="0,5,2,0" />
        <TextBox  Grid.Row="3" Grid.Column="1"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="textBox_Data" TextWrapping="Wrap" Margin="5,5,5,5" MaxLength="92" FontSize="13" IsReadOnly="True" />
        <TextBlock Grid.Row="3" Grid.Column="2"  HorizontalAlignment="Right" VerticalAlignment="Top" Text="Data to write :" TextWrapping="Wrap" Margin="0,5,5,0" />
        <TextBox  Grid.Row="3" Grid.Column="3"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="textBox_ToWrite" TextWrapping="Wrap" Margin="0,5,5,5" MaxLength="77" FontSize="13" />
        <!--Row 4-->
        <TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Send Requests:" />
        <Button Grid.Row="4" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Name="button_Read" Content="READ" Margin="30,2,40,2" Click="Button_Read_Click" IsEnabled="False" />
        <Button Grid.Row="4" Grid.Column="3"  HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Content="WRITE" Margin="30,2,40,2" Name="button_Write" Click="Button_Write_Click" IsEnabled="False" />
        <!--Row 5-->
        <TextBlock  Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Text="Info Log:" TextWrapping="Wrap" Margin="5,5,5,0" TextAlignment="Right" />
        <TextBox  Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="textBox_Logging" TextWrapping="Wrap" Margin="5,5,5,5" IsReadOnly="True" Background="LightGoldenrodYellow" />
        <!--Row 6-->
        <Border Grid.Row="6" Grid.Column="2" Name="border_Result" HorizontalAlignment="Center" VerticalAlignment="Center" Height="25" Width="25" Margin="0,5,0,5" Background="Transparent" />
        <TextBlock Grid.Row="6" Grid.Column="1"  Name="textBlock_ResultTitle" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Op.Result →" Margin="0,0,10,0" FontSize="15" />
        <!--Row 7-->
        <TextBlock Grid.Row="7" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Reader ID:" Margin="10,5,5,5" />
        <TextBlock Grid.Row="7" Grid.Column="1" Name="textBlock_ReaderID" HorizontalAlignment="Left" VerticalAlignment="Center" Text="0000000" Margin="10,5,0,5" />
        <TextBlock Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Battery:" Margin="0,5,10,5" />
        <TextBlock Grid.Row="7" Grid.Column="2" Grid.ColumnSpan="2" Name="textBlock_Battery" HorizontalAlignment="Left" VerticalAlignment="Center" Text="- - -" Margin="10,5,0,5" />
    </Grid>
</Window>
