<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:SampleBlocking_VB"
        mc:Ignorable="d" Loaded="Window_Loaded" Closing="Window_Closing"
        Title="SampleCode_iIDrl_T200_WPF - Async" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TabControl Grid.Row="0" Name="tabControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
            <TabItem Name="tabItem_Initialize" Header="Initiailze" >
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Grid Grid.Row="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Text="Port Type: " Margin="5" />
                        <RadioButton Grid.Column="1" Name="radioButtonInitialize_PortSerial" Content="Serial" GroupName="PortType" Margin="5" />
                        <RadioButton Grid.Column="2" Name="radioButtonInitialize_PortBt" Content="Bluetooth" GroupName="PortType" Margin="5" />
                        <RadioButton Grid.Column="3" Name="radioButtonInitialize_PortUsb" Content="USB" GroupName="PortType" Margin="5" IsChecked="True" />
                    </Grid>
                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Text="Port Name: " Margin="5" />
                        <TextBox Grid.Column="1" Name="textBoxInitialize_PortName" Text="COM1" Width="50" Margin="5" />
                    </Grid>
                    <Grid Grid.Row="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <Button Grid.Column="0" Name="buttonInitialize" Content="Initialize" Width="100" Margin="5" Click="ButtonInitialize_Click" />
                        <Button Grid.Column="1" Name="buttonTerminate" Content="Terminate" Width="100" Margin="5" Click="ButtonTerminate_Click" />
                    </Grid>
                    <Grid Grid.Row="3">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Text="Library version: " Margin="5" />
                        <TextBlock Grid.Column="1" Name="textBlockInitialize_DriverVersion" Margin="5" />
                    </Grid>
                    <Grid Grid.Row="4">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <TextBlock Grid.Row="0" Text="Parameters used for initialize: " Margin="5" />
                        <TextBlock Grid.Row="1" Name="textBlockInitialize_ParamInterfaceType" Margin="20,5" />
                        <TextBlock Grid.Row="2" Name="textBlockInitialize_ParamPortType" Margin="20,5" />
                        <TextBlock Grid.Row="3" Name="textBlockInitialize_ParamPortName" Margin="20,5" />
                        <TextBlock Grid.Row="4" Name="textBlockInitialize_ParamProtocolType" Margin="20,5" />
                    </Grid>
                </Grid>
            </TabItem>
            <TabItem Name="tabItem_T200" Header="TELID® sensor functions" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="250" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Button Grid.Column="0" Name="button_GetSensor" Content="Get Sensor" Margin="5" Click="Button_GetSensor_Click" />
                        </Grid>
                        <Grid Grid.Row="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>

                            <TextBlock Grid.Row="0" Text="Result: " Margin="5" />
                            <TextBox Grid.Row="1" Name="textBox_Result" VerticalAlignment="Stretch" Margin="5,0,0,0" FontSize="12" Text="0" IsEnabled="False" TextWrapping="Wrap" />
                        </Grid>
                    </Grid>
                    <TextBox Grid.Column="1" Name="textBox_ThreadLog" VerticalAlignment="Stretch" FontSize="12" Text="" Background="LightCyan" VerticalScrollBarVisibility="Auto" />
                </Grid>
            </TabItem>
        </TabControl>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <TextBlock Grid.Row="1" Name="textBlock_ReaderInfo" Text="Loading..." Margin="5" />
            <TextBlock Grid.Row="1" Name="textBlock_Status" Text="" Margin="5" />
        </StackPanel>
    </Grid>
</Window>
