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
159
160
161
162
163
164
165
166
167
168
169
170
<UserControl x:Class="XHandler.View.Consumables.LidSetting"
             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.Consumables"
             xmlns:str="clr-namespace:XHandler.Properties"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             xmlns:colorpicker="clr-namespace:XHandler.View.ColorPicker"
             Loaded="UserControl_Loaded">
 
    <Grid x:Name="gdMainLidSetting"  IsEnabled="{Binding is_default_type, Converter={StaticResource intToEnableConvert}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="20 0">
            <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static str:Resources.strGap}" VerticalAlignment="Center" FontSize="16" Margin="0 0 20 0"/>
            <CheckBox x:Name="checkboxWN" Width="60" Height="30" Style="{DynamicResource gapCheckBoxSytle}" Content="{x:Static str:Resources.strWN}"
                                     FontSize="16" Background="White" Margin="0 0 0 0" HorizontalAlignment="Center"
                                     VerticalContentAlignment="Center" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"/>
            <CheckBox x:Name="checkboxWS" Width="60" Height="30" Style="{DynamicResource gapCheckBoxSytle}" Content="{x:Static str:Resources.strWS}"
                                     FontSize="16" Background="White" Margin="-1 0 0 0" HorizontalAlignment="Center"
                                     VerticalContentAlignment="Center" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"/>
            <CheckBox x:Name="checkboxEN" Width="60" Height="30" Style="{DynamicResource gapCheckBoxSytle}" Content="{x:Static str:Resources.strEN}"
                                     FontSize="16" Background="White" Margin="-1 0 0 0" HorizontalAlignment="Center"
                                     VerticalContentAlignment="Center" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"/>
            <CheckBox x:Name="checkboxES" Width="60" Height="30" Style="{DynamicResource gapCheckBoxSytle}" Content="{x:Static str:Resources.strES}"
                                     FontSize="16" Background="White" Margin="-1 0 0 0" HorizontalAlignment="Center"
                                     VerticalContentAlignment="Center" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"/>
        </StackPanel>
        <Grid x:Name="gdLidColor" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=".2*"/>
                <ColumnDefinition Width=".2*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strConsumableColor}" VerticalAlignment="Center"
                               FontSize="16" Margin="20 0 0 0" FontWeight="Bold"/>
 
            <!--宽边-->
            <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static str:Resources.strWideSide}" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <!--<ComboBox x:Name="cbWideColor" Grid.Row="2" Grid.Column="0" Height="30" BorderThickness="0" VerticalAlignment="Top"
                      Margin="20 0 30 0" Style="{DynamicResource ColorComboBoxStyle}"
                      SelectionChanged="cbWideColor_SelectionChanged" IsEditable="False"/>-->
 
            <colorpicker:ColorPickerBtn x:Name="btnWideColor" Grid.Row="2" Grid.Column="0" Height="30" VerticalAlignment="Top"
                                         Margin="20 0 30 0" SelectedColorChangedEvent="btnWideColor_SelectedColorChangedEvent"/>
 
            <!--窄边-->
            <TextBlock Grid.Row="1" Grid.Column="1" Text="{x:Static str:Resources.strNarrowSide}" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <!--<ComboBox x:Name="cbSideColor" Grid.Row="2" Grid.Column="1" Height="30" BorderThickness="0" VerticalAlignment="Top"
                              Margin="20 0 30 0" Style="{DynamicResource ColorComboBoxStyle}" SelectionChanged="cbSideColor_SelectionChanged" IsEditable="False"/>-->
            <colorpicker:ColorPickerBtn x:Name="btnLeftSideColor" Grid.Row="2" Grid.Column="1" Height="30" VerticalAlignment="Top"
                                         Margin="20 0 30 0" SelectedColorChangedEvent="btnLeftSideColor_SelectedColorChangedEvent"/>
 
            <!--顶部-->
            <TextBlock Grid.Row="3" Grid.Column="0" Text="{x:Static str:Resources.strTopSide}" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <!--<ComboBox x:Name="cbTopColor" Grid.Row="4" Grid.Column="0" Height="30" BorderThickness="0" VerticalAlignment="Top"
                              Margin="20 0 30 0" Style="{DynamicResource ColorComboBoxStyle}" SelectionChanged="cbTopColor_SelectionChanged" IsEditable="False"/>-->
            <!--<ComboBox Grid.Row="4" Grid.Column="0" x:Name="cbTopColor" Height="30" BorderThickness="0" VerticalAlignment="Center"
                      Margin="20 0 0 0" Style="{DynamicResource ColorComboBoxStyle}" SelectionChanged="cbTopColor_SelectionChanged"
                      Width="150" HorizontalAlignment="Left" IsEditable="False"/>-->
            <colorpicker:ColorPickerBtn x:Name="btnTopColor" Grid.Row="4" Grid.Column="0" Height="30" VerticalAlignment="Top"
                                         Margin="20 0 30 0" SelectedColorChangedEvent="btnTopColor_SelectedColorChangedEvent"/>
 
            <!--边线-->
            <TextBlock x:Name="tbxBorderLine" Grid.Row="3" Grid.Column="1" Text="{x:Static str:Resources.strBorderLine}" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <!--<ComboBox x:Name="cbLineColor" Grid.Row="4" Grid.Column="1" Height="30" BorderThickness="0" VerticalAlignment="Top"
                      Margin="20 0 30 0" Style="{DynamicResource ColorComboBoxStyle}" SelectionChanged="cbLineColor_SelectionChanged" IsEditable="False"/>-->
 
            <colorpicker:ColorPickerBtn x:Name="btnLineColor" Grid.Row="4" Grid.Column="1" Height="30" VerticalAlignment="Top"
                                         Margin="20 0 30 0" SelectedColorChangedEvent="btnLineColor_SelectedColorChangedEvent"/>
 
            <Grid Grid.Row="0" Grid.Column="2" Grid.RowSpan="5" x:Name="gridGapLabware" Margin="50 10 0 0">
 
            </Grid>
        </Grid>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strConsumableSize}" VerticalAlignment="Center"
                               FontSize="16" Margin="20 0 0 0" FontWeight="Bold"/>
            <TextBlock Grid.Row="1" Grid.Column="0" Text="L (mm)" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <TextBlock Grid.Row="1" Grid.Column="1" Text="W (mm)" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <TextBlock Grid.Row="1" Grid.Column="2" Text="H (mm)" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <TextBlock Grid.Row="1" Grid.Column="3" Text="顶厚度 (mm)" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <!--<TextBox Grid.Row="2" Grid.Column="0" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" Text="{Binding labware_length, Mode=TwoWay}"/>-->
            <TextBox x:Name="tblabware_length" Grid.Row="2" Grid.Column="0" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" >
                <TextBox.Text>
                    <Binding Path="labware_length" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:ConsumablesValidationRule  ValidateType="1,4@[2],5@[0-1000]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="1" Grid.Column="0" x:Name="lLError" Text="{Binding  ElementName=tblabware_length,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
 
            <!--<TextBox Grid.Row="2" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" Text="{Binding labware_width, Mode=TwoWay}"/>-->
            <TextBox x:Name="tblabware_width" Grid.Row="2" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" >
                <TextBox.Text>
                    <Binding Path="labware_width" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:ConsumablesValidationRule  ValidateType="1,4@[2],5@[0-1000]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="1" Grid.Column="1" x:Name="lWError" Text="{Binding  ElementName=tblabware_width,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
 
            <!--<TextBox Grid.Row="2" Grid.Column="2" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" Text="{Binding labware_height, Mode=TwoWay}"/>-->
            <TextBox x:Name="tblabware_height" Grid.Row="2" Grid.Column="2" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" >
                <TextBox.Text>
                    <Binding Path="labware_height" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:ConsumablesValidationRule  ValidateType="1,4@[2],5@[0-1000]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="1" Grid.Column="2" x:Name="lHError" Text="{Binding  ElementName=tblabware_height,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
 
            <!--<TextBox Grid.Row="2" Grid.Column="3" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" Text="{Binding with_lid_height, Mode=TwoWay}"/>-->
            <TextBox x:Name="tbwith_lid_height" Grid.Row="2" Grid.Column="3" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" >
                <TextBox.Text>
                    <Binding Path="with_lid_height" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:ConsumablesValidationRule  ValidateType="1,4@[2],5@[0-1000]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="1" Grid.Column="3" x:Name="wLHError" Text="{Binding  ElementName=tbwith_lid_height,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
        </Grid>
    </Grid>
</UserControl>