schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<UserControl x:Class="XHandler.View.BacteriaProperty.PickProperty"
             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:XHandler.View.BacteriaProperty"
             xmlns:str="clr-namespace:XHandler.Properties"
             xmlns:ctrls="clr-namespace:XHandler.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
    <ScrollViewer x:Name="scrollViewer">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="60"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strCommandTag}" FontSize="16"
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 0 15 0"/>
            <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static str:Resources.strCommandName}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 0 15 0"/>
 
            <TextBox Grid.Row="0" Grid.Column="1" x:Name="tbxCommandLabel" Grid.ColumnSpan="2" Height="30" FontSize="16" VerticalContentAlignment="Center" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                 Text="{Binding label, Mode=TwoWay}" TextChanged="tbxCommandLabel_TextChanged" IsEnabled="False"/>
            <!--<TextBox Grid.Row="1" Grid.Column="1" x:Name="tbxCommandName" Grid.ColumnSpan="2" Height="30" FontSize="16" VerticalContentAlignment="Center" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                 Text="{Binding name}" TextChanged="tbxCommandName_TextChanged"/>-->
            <TextBox x:Name="tbxCommandName" Grid.Row="1" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                     BorderThickness="0" TextChanged="tbxCommandName_TextChanged">
                <TextBox.Text>
                    <Binding Path="name" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:BacteriaPropertyValidationRule  ValidateType="1,6@[100]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="1" Grid.Column="2" x:Name="nError" Text="{Binding  ElementName=tbxCommandName,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
 
            <TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Static str:Resources.strArm}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <ComboBox x:Name="cbArm" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                      DisplayMemberPath="device_arm_name" SelectedValuePath="device_arm_id" SelectionChanged="cbArm_SelectionChanged" IsEditable="False"/>
 
            <TextBlock Grid.Row="3" Grid.Column="0" Text="{x:Static str:Resources.strBacteriaHead}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <TextBox x:Name="textboxArmHead" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Height="30" FontSize="16" VerticalContentAlignment="Center" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                 Text="" IsEnabled="False"/>
            <ctrls:TipsChannel x:Name="tipsChannel" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" TotalChannels="8" Height="70" Background="White" CanEdit="False"
                               HorizontalAlignment="Left" SelectedChangedEvent="tipsChannel_SelectedChangedEvent"/>
 
            <TextBlock Grid.Row="5" Grid.Column="0" Text="{x:Static str:Resources.strTablePosition}" FontSize="16"
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 0 15 0"/>
            <!--<ctrls:PromptTextBox x:Name="tbSelectTable" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Height="30" FontSize="16" VerticalContentAlignment="Center"
                                 Watermark="{x:Static str:Resources.strPleaseSelect}" Background="{DynamicResource lightGrayBrush}" BorderThickness="0"
                                 Text="{Binding positionText}"/>-->
            <ComboBox x:Name="comboboxTablePos" Grid.Row="5" Grid.Column="1" Height="30" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}" BorderThickness="0"
                      SelectionChanged="comboboxTablePos_SelectionChanged" IsEditable="False"/>
 
            <TextBlock Grid.Row="6" Grid.Column="0" Text="{x:Static str:Resources.strBacteria}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <ComboBox x:Name="cbBacteria" Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                      DisplayMemberPath="bacteria_name" SelectedValuePath="bacteria_id" SelectionChanged="cbBacteria_SelectionChanged" IsEditable="False"/>
 
            <TextBlock Grid.Row="7" Grid.Column="0" Text="{x:Static str:Resources.strPickFileSet}" FontSize="16" FontWeight="Bold"
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 0 15 0"/>
 
            <TextBlock Grid.Row="8" Grid.Column="0" Text="{x:Static str:Resources.strFile}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <!--<TextBox x:Name="tbExcelFile" Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="2" FontSize="16" VerticalContentAlignment="Center" Height="30" Margin="0 0 40 0" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                         Text="{Binding filePath, Mode=TwoWay}" PreviewKeyDown="tbExcelFile_PreviewKeyDown"/>-->
            <TextBox x:Name="tbExcelFile" Grid.Row="8" Grid.Column="1" Height="30" Grid.ColumnSpan="2" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}" Margin="0 0 40 0"
                     BorderThickness="0" PreviewKeyDown="tbExcelFile_PreviewKeyDown">
                <TextBox.Text>
                    <Binding Path="filePath" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:BacteriaPropertyValidationRule  ValidateType="1,6@[100]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="8" Grid.Column="3" x:Name="efError" Text="{Binding  ElementName=tbExcelFile,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5 5 5 0"/>
            
            <ctrls:ImageButton Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="2" x:Name="btnSelectFile" NormalImage="pack://application:,,,./Assets/CmdSet/文件.png" Width="40" Height="30" ImageWidth="32" ImageHeight="32" 
                           HorizontalAlignment="Right" VerticalAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                           Click="btnSelectFile_Click"/>
 
 
            <TextBlock Grid.Row="9" Grid.Column="0" Text="{x:Static str:Resources.strFilePreview}" FontSize="16" 
                   VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 10 15 0"/>
 
            <Border Grid.Row="10" Grid.Column="1" Grid.ColumnSpan="3" Background="{DynamicResource lightGrayBrush}" CornerRadius="5" Margin="0 5 5 5" Height="200">
                <DataGrid x:Name="dgTransferFileData" AutoGenerateColumns="True" IsReadOnly="True" BorderThickness="1" FontSize="14"
                      RowHeaderWidth="0" BorderBrush="LightGray" CanUserResizeColumns="False" CanUserResizeRows="False" 
                      CanUserSortColumns="False" CanUserReorderColumns="False" CanUserAddRows="False"></DataGrid>
            </Border>
 
            <TextBlock Grid.Row="11" Grid.Column="0" Text="{x:Static str:Resources.strFrom}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <!--<TextBox Grid.Row="11" Grid.Column="1" x:Name="tbxbeginLine" FontSize="16" VerticalContentAlignment="Center" Height="30" Margin="0 0 0 0" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                         Text="{Binding beginLine, Mode=TwoWay}" TextChanged="tbxbeginLine_TextChanged"/>-->
            <TextBox x:Name="tbxbeginLine" Grid.Row="11" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}" Margin="0 0 0 0"
                     BorderThickness="0" TextChanged="tbxbeginLine_TextChanged">
                <TextBox.Text>
                    <Binding Path="beginLine" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:BacteriaPropertyValidationRule  ValidateType="1,6@[100],9"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="11" Grid.Column="3" x:Name="blError" Text="{Binding  ElementName=tbxbeginLine,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30 0 5 0"/>
            
            <TextBlock Grid.Row="11" Grid.Column="2" Grid.ColumnSpan="2" Text="{x:Static str:Resources.strBeginReadData}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="15 0 15 0"/>
 
            <TextBlock Grid.Row="12" Grid.Column="0" Text="{x:Static str:Resources.strSourceDish}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <ComboBox x:Name="cbSourceBoard" Grid.Row="12" Grid.Column="1" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" 
                  DisplayMemberPath="header_name" IsEditable="False" SelectionChanged="cbSourceBoard_SelectionChanged"/>
            <TextBlock Grid.Row="12" Grid.Column="2" Text="{x:Static str:Resources.strMachineCoordinate}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <ComboBox x:Name="cbMachineCoordinate" Grid.Row="12" Grid.Column="3" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" 
                  DisplayMemberPath="header_name" IsEditable="False" SelectionChanged="cbMachineCoordinate_SelectionChanged"/>
 
            <TextBlock Grid.Row="13" Grid.Column="0" Text="{x:Static str:Resources.strPickMode}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <ComboBox x:Name="cbPickMode" Grid.Row="13" Grid.Column="1" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" 
                      DisplayMemberPath="dropdown_name" SelectedValuePath="dropdown_id" SelectionChanged="cbPickMode_SelectionChanged" IsEditable="False"/>
 
            <TextBlock Grid.Row="13" Grid.Column="2" Text="{x:Static str:Resources.strChoiceStartPos}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
            <TextBox Grid.Row="13" Grid.Column="3" x:Name="tbxStartPos" FontSize="16" VerticalContentAlignment="Center" Height="30" Margin="0 0 0 0" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                         Text="{Binding startPos, Mode=TwoWay}" TextChanged="tbxStartPos_TextChanged"/>
 
        </Grid>
    </ScrollViewer>
</UserControl>