<Window x:Class="HighSpeedApiDemo.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:HighSpeedApiDemo"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="32"/>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <TextBlock Text="服务器地址:"  HorizontalAlignment="Left" VerticalAlignment="Center" Margin="6,0,0,0"/>
        <TextBox x:Name="ip" Width="200" HorizontalAlignment="Left" Margin="86,0,0,0" VerticalAlignment="Center" Text="{Binding Ip,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" />
        <Button Content="Connect" HorizontalAlignment="Right" Margin="0,0,65,0" VerticalAlignment="Center" Command="{Binding ConnectCommand}"/>
        <Button Content="Stop" HorizontalAlignment="Right" Margin="0,0,10,0" VerticalAlignment="Center" Width="50" Command="{Binding StopCommand}"/>

        <DataGrid Grid.Row="1" IsReadOnly="True" ItemsSource="{Binding Tags}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Id" Binding="{Binding Id}" Width="32" />
                <DataGridTemplateColumn Header="Value" Width="*">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Value}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>

    </Grid>
</Window>
