<Window x:Class="WpfApplication_ModbusClient.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,41,0,0" Name="textBlock1" VerticalAlignment="Top" >
            <Run Text="Addr01="/>
            <Run Text="{Binding Addr01, StringFormat={}{0:X4}}"/>
            <Run Text="Addr02="/>
            <Run Text="{Binding Addr02, StringFormat={}{0:X4}}"/>
        </TextBlock>
        <Button Content="获取" Height="23" HorizontalAlignment="Left" Margin="12,70,0,0" Name="button2" VerticalAlignment="Top" Width="75" Click="button2_Click" />
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBlock2" VerticalAlignment="Top"  >
            <Run Text="连接状态:" />
            <Run Text="{Binding IsConnected, Mode=OneWay}"  />
        </TextBlock>
        <TextBox Height="23" HorizontalAlignment="Left" Margin="234,41,0,0" Name="textBox1" VerticalAlignment="Top" Width="75" />
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="234,12,0,0" Name="textBlock3" Text="Addr01" VerticalAlignment="Top" />
        <Button Content="设置" Height="23" HorizontalAlignment="Left" Margin="315,73,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
        <TextBox Height="23" HorizontalAlignment="Left" Margin="315,41,0,0" Name="textBox2" VerticalAlignment="Top" Width="75" />
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="315,12,0,0" Name="textBlock4" Text="Addr02" VerticalAlignment="Top" />
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,119,0,0" Name="textBlock5" VerticalAlignment="Top">
            <Run Text="Addr01_bit=" /> 
            <Run Text="{Binding Addr01_bit}" />
            <Run Text="Addr02_bit=" />
            <Run Text="{Binding Addr02_bit}" />
        </TextBlock>
        <Button Content="获取" Height="23" HorizontalAlignment="Left" Margin="12,148,0,0" Name="button3" VerticalAlignment="Top" Width="75" Click="button3_Click" />
        <Button Content="设置" Height="23" HorizontalAlignment="Left" Margin="235,155,0,0" Name="button4" VerticalAlignment="Top" Width="75" Click="button4_Click" />
        <CheckBox Content="Addr01_bit" Height="16" HorizontalAlignment="Left" Margin="234,111,0,0" Name="checkBox1" VerticalAlignment="Top" />
        <CheckBox Content="Addr02_bit" Height="16" HorizontalAlignment="Left" Margin="234,133,0,0" Name="checkBox2" VerticalAlignment="Top" />
    </Grid>
</Window>
