<Window x:Class="DBGrpcApiDemo.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:DBGrpcApiDemo"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition Height="411*"/>
        </Grid.RowDefinitions>
        <Label Content="Server:" HorizontalAlignment="Left" Margin="11,0,0,0" VerticalAlignment="Top"/>
        <TextBox x:Name="ServerIp"  HorizontalAlignment="Left" Margin="67,0,0,0" Text="{Binding Ip,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" TextWrapping="Wrap" VerticalAlignment="Center" Width="196"/>
        <Button x:Name="StartB" Command="{Binding LoginCommand}" Content="开始" Margin="0,0,13,0" VerticalAlignment="Center" HorizontalAlignment="Right" Width="60"/>
        <TextBox x:Name="ServerIp_Copy"  HorizontalAlignment="Left" Margin="329,0,0,0" Text="{Binding Port, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" TextWrapping="Wrap" VerticalAlignment="Center" Width="87"/>
        <Label Content="Port:" HorizontalAlignment="Left" Margin="274,0,0,0" VerticalAlignment="Center"/>

        <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" />
                <DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="*" />
                <DataGridTemplateColumn Header="Value" Width="*">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Value}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>

    </Grid>
</Window>
