EquipmentAddOrEdit.xaml
3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<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>