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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<Window x:Class="XHandler.View.MethodProperty.SetBarcodeDlgForAddConsumables"
             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.MethodProperty"
             xmlns:str="clr-namespace:XHandler.Properties"
             mc:Ignorable="d" WindowStartupLocation = "CenterOwner"
             Height="650" Width="800" WindowStyle="None" AllowsTransparency="True" ResizeMode="NoResize" Background="#00FFFFFF"
             Loaded="Window_Loaded">
 
    <Window.Resources>
        <Style TargetType="DataGridRow">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Background" Value="White" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="FontSize" Value="16" />
            <Setter Property="Foreground" Value="Black" />
 
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource lightBlueBrush}"/>
                    <Setter Property="Foreground" Value="Black"/>
                </Trigger>
 
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{DynamicResource blueBrush}"/>
 
                </Trigger>
            </Style.Triggers>
 
        </Style>
 
        <Style x:Key="cellStyle" TargetType="DataGridCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DataGridCell">
                        <Border BorderBrush="LightGray" BorderThickness="0 0 0 1"  Background="{TemplateBinding Background}">
                            <Grid>
                                <TextBlock TextAlignment="Center" VerticalAlignment="Center"  >
                                    <ContentPresenter />
                                </TextBlock>
 
                                <Path Fill="LightGray" Data="M8,0 L8,8 0,8z" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
 
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource lightBlueBrush}"/>
                    <Setter Property="Foreground" Value="Black"/>
                </Trigger>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{DynamicResource blueBrush}"/>
                    <Setter Property="Foreground" Value="White"/>
                </Trigger>
                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static DataGrid.FocusBorderBrushKey}}"/>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsSelected" Value="true"/>
                        <Condition Property="Selector.IsSelectionActive" Value="false"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="Background" Value="{DynamicResource blueBrush}"/>
                    <Setter Property="Foreground" Value="White"/>
                </MultiTrigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
 
        <Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Border BorderBrush="LightGray" BorderThickness="0 0 0 1" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <Grid>
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                <Path Fill="LightGray" Data="M12,0 L12,8 0,8z" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <EventSetter Event="PreviewMouseMove" Handler="DataGridCell_PreviewMouseMove"/>
            <!--<EventSetter Event="PreviewMouseLeftButtonDown" Handler="DataGridCell_PreviewMouseLeftButtonDown"/>-->
 
            <EventSetter Event="PreviewMouseDoubleClick" Handler="DataGridCell_PreviewMouseDoubleClick"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource lightBlueBrush}"/>
                    <Setter Property="Foreground" Value="Black"/>
                </Trigger>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{DynamicResource blueBrush}"/>
                    <Setter Property="Foreground" Value="White"/>
                </Trigger>
                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static DataGrid.FocusBorderBrushKey}}"/>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsSelected" Value="true"/>
                        <Condition Property="Selector.IsSelectionActive" Value="false"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="Background" Value="{DynamicResource blueBrush}"/>
                    <Setter Property="Foreground" Value="White"/>
                </MultiTrigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
 
        <Style x:Key="eidtTextBoxStyle" TargetType="TextBox">
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate >
                        <Grid>
                            <Border x:Name="BackBorder" SnapsToDevicePixels="true" Background="{TemplateBinding Background}"
                            BorderThickness="0" BorderBrush="{TemplateBinding BorderBrush}" Height="40">
                                <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <!--<Trigger Property="IsFocused" Value="True" >
                                <Setter Property="Background" TargetName="BackBorder" Value="#FFE5E6EB"/>
                            </Trigger>-->
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="TextBox.Foreground" Value="Gray"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
 
    <Grid Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
 
        <Grid Grid.Row="0" MouseDown="Grid_MouseDown">
            <Border Grid.Row="0" Background="{DynamicResource blueBrush}" CornerRadius="10 10 0 0" BorderThickness="0">
                <Grid>
                    <TextBlock Text="{x:Static str:Resources.strTips}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0" FontSize="20"
                               Foreground="White" FontWeight="Bold" Width="450"/>
                    <Button Content="×" HorizontalAlignment="Right" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="10 0" FontSize="28" Width="40" Height="40"
                            FontWeight="Bold" Foreground="Gray" Style="{DynamicResource BlueButtonStyle}" Background="White" Click="btnClose_Click"/>
                </Grid>
            </Border>
        </Grid>
        
        <Border Grid.Row="1" Background="White" CornerRadius="0 0 10 10" BorderThickness="0">
            <Grid Margin="50 0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="100"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="40"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
 
                <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Margin="0 20 0 0" HorizontalAlignment="Center">
                    <TextBlock x:Name="textblockMsg" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 0 0 0" FontSize="16"/>
                </StackPanel>
 
                <DataGrid x:Name="dgInputBarcode" Grid.Row="1" Grid.Column="0" AutoGenerateColumns="False" BorderThickness="0" FontSize="14"
                              RowHeaderWidth="0" BorderBrush="LightGray" CanUserResizeColumns="False" CanUserResizeRows="False" Margin="50 10" Background="White"
                              CanUserSortColumns="False" CanUserReorderColumns="False" CanUserAddRows="False" ColumnHeaderStyle="{DynamicResource dataGridColumnHeaderStyle}"
                              GridLinesVisibility="None" SelectionUnit="Cell" SelectionMode="Extended"
                              CellEditEnding="dgCoatingData_CellEditEnding">
 
                    <DataGrid.Columns>
                        <DataGridTextColumn Width="*" Binding="{Binding lattice_num}" Header="{x:Static str:Resources.strTargetBoard}" 
                                                CellStyle="{StaticResource cellStyle}" IsReadOnly="True"/>
                        <DataGridTextColumn Width="*" Binding="{Binding targetplate_barcode}" Header="{x:Static str:Resources.strDestBoardBarcode}" 
                                                CellStyle="{StaticResource DataGridCellStyle}"
                                                EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                    </DataGrid.Columns>
                </DataGrid>
 
 
                <Button Grid.Row="2" Grid.Column="0" x:Name="btnOK" Content="{x:Static str:Resources.btnOK}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 0 0" FontSize="16" Width="80" Height="40"
                            Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Click="btnOK_Click"/>
                <Button Grid.Row="2" Grid.Column="0" Content="{x:Static str:Resources.btnCancel}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 120 0" FontSize="16" Width="80" Height="40"
                            Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="LightGray" Click="btnClose_Click"/>
            </Grid>
        </Border>
    </Grid>
 
 
 
</Window>