<UserControl x:Class="DeviceManagement.Views.Dialog.EditDevice"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:DeviceManagement.Views.Dialog"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary Source="/UICommon;component/Resources.xaml"/>
    </UserControl.Resources>
    <Grid Width="450">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="8"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="16"/>
        </Grid.RowDefinitions>
        <Grid Margin="16" TextElement.FontSize="14">
            <Grid.RowDefinitions>
                <RowDefinition Height="24"/>
                <RowDefinition Height="8"/>
                <RowDefinition Height="24"/>
                <RowDefinition Height="8"/>
                <RowDefinition Height="32"/>
                <RowDefinition Height="8"/>
                <RowDefinition Height="32"/>
                <RowDefinition Height="8"/>
                <RowDefinition Height="32"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="16"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">设备型号：</TextBlock>
            <TextBlock Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Text="{Binding TempDevice.DeviceModel}"></TextBlock>

            <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">子型号：</TextBlock>
            <TextBlock Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Text="{Binding TempDevice.DeviceSubModel}"></TextBlock>

            <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center">网络地址：</TextBlock>
            <Grid Grid.Row="4" Grid.Column="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="8"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBox Text="{Binding TempDevice.IP, Mode=TwoWay}" VerticalContentAlignment="Center"/>
                <TextBlock Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">:</TextBlock>
                <TextBox Grid.Column="2" Text="{Binding TempDevice.Port,Mode=TwoWay}" VerticalContentAlignment="Center"/>
            </Grid>


            <TextBlock Grid.Row="6" Grid.Column="0" VerticalAlignment="Center">设备名称：</TextBlock>
            <TextBox Grid.Row="6" Grid.Column="2" VerticalContentAlignment="Center" Text="{Binding TempDevice.DeviceName, Mode=TwoWay}"/>

            <TextBlock Grid.Row="8" Grid.Column="0" VerticalAlignment="Center">位置备注：</TextBlock>
            <TextBox Grid.Row="8" Grid.Column="2" VerticalContentAlignment="Center" Text="{Binding TempDevice.Position, Mode=TwoWay}"/>

        </Grid>

        <Grid Grid.Row="2" Margin="16,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="16"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Button Height="32" Background="Transparent" 
                    BorderBrush="{StaticResource ThemeColor}" TextElement.Foreground="{StaticResource ThemeColor}"
                    Command="{Binding SaveDeviceCommand}">保存设备</Button>
            <Button Height="32" Grid.Column="2" Background="Transparent" 
                    BorderBrush="{StaticResource DisableColor}" TextElement.Foreground="{StaticResource DisableColor}"
                    Command="{Binding CloseCommand}">返回</Button>
        </Grid>
    </Grid>
</UserControl>
