CommunicationAddOrEditView.xaml
4.57 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<Window
x:Class="HHECS.RobotTool.View.CommunicationView.CommunicationAddOrEditView"
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:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:HHECS.RobotTool.View.CommunicationView"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodel="clr-namespace:HHECS.RobotTool.ViewModel.CommunicationVM"
Title="新增通讯配置"
Width="290"
Height="315"
d:DataContext="{d:DesignInstance Type=viewmodel:CommunicationAddOrEditVM}"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<hc:UniformSpacingPanel
Grid.Row="0"
Margin="5"
HorizontalAlignment="Center"
Orientation="Vertical"
Spacing="5">
<TextBox
MinWidth="260"
hc:InfoElement.Necessary="True"
hc:InfoElement.Title="编号"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="70"
Style="{StaticResource TextBoxExtend}"
Text="{Binding CommunicationConfig.Code, UpdateSourceTrigger=PropertyChanged}" />
<TextBox
hc:InfoElement.Necessary="True"
hc:InfoElement.Title="名称"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="70"
Style="{StaticResource TextBoxExtend}"
Text="{Binding CommunicationConfig.Name, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox
hc:InfoElement.Necessary="True"
hc:InfoElement.Title="通讯方式"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="70"
DisplayMemberPath="Key"
ItemsSource="{Binding CommunicationTypes}"
SelectedValue="{Binding CommunicationConfig.CommunicationType}"
SelectedValuePath="Value"
Style="{StaticResource ComboBoxExtend}" />
<TextBox
hc:InfoElement.Necessary="True"
hc:InfoElement.Title="IP地址"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="70"
Style="{StaticResource TextBoxExtend}"
Text="{Binding CommunicationConfig.IpAddress, UpdateSourceTrigger=PropertyChanged}" />
<TextBox
hc:InfoElement.Title="端口号"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="70"
Style="{StaticResource TextBoxExtend}"
Text="{Binding CommunicationConfig.Port, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox
hc:InfoElement.Necessary="True"
hc:InfoElement.Title="是否启用"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="70"
SelectedValue="{Binding CommunicationConfig.IsEnable, UpdateSourceTrigger=PropertyChanged}"
SelectedValuePath="Tag"
Style="{StaticResource ComboBoxExtend}">
<ComboBoxItem Content="启用" Tag="False" />
<ComboBoxItem Content="禁用" Tag="True" />
</ComboBox>
<TextBox
hc:InfoElement.Title="备注"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="70"
Style="{StaticResource TextBoxExtend}"
Text="{Binding CommunicationConfig.Remark, UpdateSourceTrigger=PropertyChanged}" />
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel
Grid.Row="1"
HorizontalAlignment="Center"
Spacing="60">
<Button
hc:IconElement.Geometry="{StaticResource SaveGeometry}"
Command="{Binding SaveCommand}"
Content="保存"
Style="{StaticResource ButtonPrimary}" />
<Button
hc:IconElement.Geometry="{StaticResource CloseGeometry}"
Command="{Binding CancelCommand}"
Content="取消"
Style="{StaticResource ButtonDefault}" />
</hc:UniformSpacingPanel>
</Grid>
</Window>