EquipmentAddOrEdit.xaml 3.73 KB
<Window x:Class="HHECS.DAQClient.View.EquipmentView.EquipmentAddOrEditView"
        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:HHECS.DAQClient.ViewModel.EquipmentVM"
        xmlns:hc="https://handyorg.github.io/handycontrol"
        mc:Ignorable="d"
        xmlns:viewmodel="clr-namespace:HHECS.DAQClient.ViewModel.EquipmentVM"
        d:DataContext="{d:DesignInstance Type=viewmodel:EquipmentAddOrEditVM}"
        Title="新增设备" Height="350" Width="290" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <hc:UniformSpacingPanel Grid.Row="0" Spacing="5" Orientation="Vertical" HorizontalAlignment="Center" Margin="5">

            <TextBox MinWidth="260"  hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="设备编号" Text="{Binding Equipment.Code,UpdateSourceTrigger=PropertyChanged}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend}"/>

            <TextBox hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="设备名称" Text="{Binding Equipment.Name,UpdateSourceTrigger=PropertyChanged}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend}"/>

            <ComboBox ItemsSource="{Binding EquipmentTypes}" IsEnabled="{Binding CbxIsEnable}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectedValue="{Binding Equipment.EquipmentTypeId}" hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="设备类型" hc:InfoElement.Necessary="True" Style="{StaticResource ComboBoxExtend}"/>

            <TextBox hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="IP地址" Text="{Binding Equipment.IP,UpdateSourceTrigger=PropertyChanged}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend}"/>

            <TextBox hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="连接名称" Text="{Binding Equipment.ConnectName,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxExtend}"/>

            <ComboBox hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="是否启用" SelectedValuePath="Tag" SelectedValue="{Binding Equipment.Disable,UpdateSourceTrigger=PropertyChanged}" hc:InfoElement.Necessary="True" Style="{StaticResource ComboBoxExtend}">
                <ComboBoxItem Content="启用" Tag="False"/>
                <ComboBoxItem Content="禁用" Tag="True"/>
            </ComboBox>

            <TextBox hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="区域" Text="{Binding Equipment.DestinationArea,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxExtend}"/>

            <TextBox hc:InfoElement.TitleWidth="70" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="描述" Text="{Binding Equipment.Description,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxExtend}"/>
        </hc:UniformSpacingPanel>

        <hc:UniformSpacingPanel  Grid.Row="1" Spacing="60" HorizontalAlignment="Center">
            <Button Content="保存" Command="{Binding SaveCommand}" Style="{StaticResource ButtonPrimary}"/>
            <Button Content="取消" Command="{Binding CancelCommand}" Style="{StaticResource ButtonDefault}"/>
        </hc:UniformSpacingPanel>
    </Grid>
</Window>