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
209
210
211
212
213
214
215
216
217
218
219
220
<Window x:Class="XHandler.View.ManualPick.CutSetting"
        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:XHandler.View.ManualPick"
        xmlns:str="clr-namespace:XHandler.Properties"
        mc:Ignorable="d" WindowStartupLocation = "CenterOwner"
        d:DesignHeight="450" d:DesignWidth="800" WindowStyle="None" AllowsTransparency="True" ResizeMode="NoResize" Background="#00FFFFFF"
        Loaded="Window_Loaded">
    <Window.Resources>
        <Style x:Key="linkRadioButtonSytle" TargetType="{x:Type RadioButton}">
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Foreground" Value="{DynamicResource blueBrush}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                        <Grid Height="26">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="2"/>
                            </Grid.RowDefinitions>
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" 
                                          ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" 
                                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="0,0,0,0" 
                                          RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <Rectangle Grid.Row="1" Height="2" x:Name="rect" Fill="{DynamicResource blueBrush}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                            </Trigger>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter Property="Foreground" Value="Gray"/>
                                <Setter Property="Opacity" TargetName="rect" Value="0"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="{x:Null}">
                                <Setter Property="Opacity" TargetName="rect" Value="1"/>
                                <Setter Property="Foreground" Value="{DynamicResource blueBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </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 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>
 
        <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>
        <Grid Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" >
                <TextBlock Text="{x:Static str:Resources.strCutGumSetting}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0" FontSize="20"
                               FontWeight="Bold"/>
                <Button x:Name="btnOK" Grid.Row="0" Content="{x:Static str:Resources.btnOK}" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}"
                            Width="100" Height="40" FontSize="16" HorizontalAlignment="Right" Click="btnOK_Click" Margin="50 0"/>
            </Grid>
 
            <Border Grid.Row="1" Background="White" CornerRadius="0 0 10 10" BorderThickness="0">
                <Grid Margin="50 0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="2"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <DataGrid x:Name="dgCoatingData" Grid.Row="1" AutoGenerateColumns="False" BorderThickness="0" FontSize="14"
                              RowHeaderWidth="0" BorderBrush="LightGray" CanUserResizeColumns="False" CanUserResizeRows="False" Margin="0 10" Background="White"
                              CanUserSortColumns="False" CanUserReorderColumns="False" CanUserAddRows="False" ColumnHeaderStyle="{DynamicResource dataGridColumnHeaderStyle}"
                              GridLinesVisibility="None" SelectionUnit="Cell" SelectionMode="Extended"
                              BeginningEdit="dgCoatingData_BeginningEdit" CellEditEnding="dgCoatingData_CellEditEnding"
                              PreviewMouseMove="dgCoatingData_PreviewMouseMove" SelectedCellsChanged="dgCoatingData_SelectedCellsChanged"
                              PreviewMouseLeftButtonUp="dgCoatingData_PreviewMouseLeftButtonUp">
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="80" Binding="{Binding choice_id}" Header="{x:Static str:Resources.strNo}" CellStyle="{StaticResource cellStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding sourceplate}" Header="{x:Static str:Resources.strSourceTrough}" CellStyle="{StaticResource cellStyle}"
                                                EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding sourceplate_num}" Header="{x:Static str:Resources.strSourceTroughBarcode}" CellStyle="{StaticResource DataGridCellStyle}"
                                                EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding machine_coordinate}" Header="{x:Static str:Resources.strMachinePosition}" CellStyle="{StaticResource cellStyle}"
                                                 EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding pixel_coordinate}" Header="{x:Static str:Resources.strPixelPosition}" CellStyle="{StaticResource cellStyle}"
                                                 EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding targetplate}" Header="{x:Static str:Resources.strTargetBoard}" CellStyle="{StaticResource cellStyle}"
                                                EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding targetplate_num}" Header="{x:Static str:Resources.strDestBoardBarcode}" CellStyle="{StaticResource DataGridCellStyle}"
                                                EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding targetplate_well}" Header="{x:Static str:Resources.strTargetWell}" CellStyle="{StaticResource cellStyle}"
                                                EditingElementStyle="{StaticResource eidtTextBoxStyle}" IsReadOnly="True"/>
                            <DataGridTextColumn Width="*" Binding="{Binding is_new_plate_batch}" Header="is_new_plate_batch" CellStyle="{StaticResource DataGridCellStyle}" IsReadOnly="True" Visibility="Collapsed"/>
                        </DataGrid.Columns>
 
                    </DataGrid>
                </Grid>
            </Border>
        </Grid>
    </Grid>
</Window>