feat: 检测结果页 调整

master
Tongg 7 months ago
parent f17e20e3f0
commit 3708db2e1d
  1. 9
      Language/zh_CN.xaml
  2. 2
      SparkClient.sln.DotSettings.user
  3. 5
      ViewModel/Grading/GradingResultVM.cs
  4. 4
      Views/Configuration/LevelConfigPage.xaml
  5. 4
      Views/Dialog/MessageBox.xaml.cs
  6. 441
      Views/Grading/GradingResult.xaml
  7. 9
      Views/Grading/GradingResult.xaml.cs

@ -183,4 +183,13 @@
<sys:String x:Key="DiamondResultWeight">重量(ct)</sys:String>
<sys:String x:Key="DiamondResultCutGrade">切工等级</sys:String>
<sys:String x:Key="DiamondResultSymmetryGrade">对称等级</sys:String>
<sys:String x:Key="DiamondResultGridAvgValue">平均值</sys:String>
<sys:String x:Key="DiamondResultGridDeviationValue">偏差值</sys:String>
<sys:String x:Key="DiamondResultGridMaxValue">最大值</sys:String>
<sys:String x:Key="DiamondResultGridMinValue">最小值</sys:String>
<sys:String x:Key="DiamondResultGridCutLevel">切工等级</sys:String>
<sys:String x:Key="DiamondResultGridSymLevel">SYM等级</sys:String>
<sys:String x:Key="DiamondResultPopupFacet1">面1</sys:String>
</ResourceDictionary>

@ -1,6 +1,7 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAsyncVoidMethodBuilder_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F211e6f3b24fa438a92f1815153647ce2c8f908_003F18_003Feb00c5a4_003FAsyncVoidMethodBuilder_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABaseUriHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fbfd90ad81939493b96034353abcd1045825908_003Fdc_003Fff55e936_003FBaseUriHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABrushes_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F96a561fe76144633acef44f09d0dcb8a825920_003F7e_003F126cf976_003FBrushes_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AButtonBase_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6412d4331611499aab4eb63809a2a83bf60910_003Ffb_003F3185652c_003FButtonBase_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AButton_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6412d4331611499aab4eb63809a2a83bf60910_003F94_003F46375460_003FButton_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AButton_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F89a2b53da2e32f22f450ecab5f59ea9f03bfe76b409627069931a786fcee_003FButton_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
@ -26,6 +27,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonSerializer_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F7e62198beab24380bbac29171862d1d8adf10_003F9d_003Fb98e2c8a_003FJsonSerializer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonTextReader_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F7e62198beab24380bbac29171862d1d8adf10_003Fcf_003F3a31e3b0_003FJsonTextReader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJToken_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F58b0b7706a8be4f7160749424eb996a3f845a1682c3c7ac5e405a346a8c20f1_003FJToken_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fb7208b3f72528d22781d25fde9a55271bdf2b5aade4f03b1324579a25493cd8_003FList_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMaterialVariable_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F68d37d16685244cf9996bf767117a771210200_003Fe1_003Fb1acf2fc_003FMaterialVariable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMeshGeometryModel3D_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F68d37d16685244cf9996bf767117a771210200_003Fb5_003Fc0ee0c0f_003FMeshGeometryModel3D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMessageBox_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F476b8dbfd2cb40ab8ff230fdcda5e37081d20_003F0e_003F12425a46_003FMessageBox_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>

@ -35,6 +35,7 @@ public class GradingResultVM : BaseViewModel
private string _cutLevelTotal;
private string _symLevelTotal;
private string _ds;
private RowDetail _selRowDataDetail;
public ICommand SaveFileCommand { get; }
public ICommand SaveAsCommand { get; }
public List<DataInfo> DtResults { get { return _dtResults; } set { _dtResults = value; OnPropertyChanged(nameof(DtResults)); } }
@ -43,6 +44,8 @@ public class GradingResultVM : BaseViewModel
public string Shape { get { return _shape; } set { _shape = value; OnPropertyChanged(nameof(Shape)); } }
public string CrownType { get { return _crownType; } set { _crownType = value; OnPropertyChanged(nameof(CrownType)); } }
public string PavType { get { return _pavType; } set { _pavType = value; OnPropertyChanged(nameof(PavType)); } }
public RowDetail SelRowDataDetail { get { return _selRowDataDetail; } set { _selRowDataDetail = value; OnPropertyChanged(nameof(SelRowDataDetail)); } }
public string Wight { get { return _wight; } set { _wight = value; OnPropertyChanged(nameof(Wight)); } }
public string CutLevelTotal { get { return _cutLevelTotal; } set { _cutLevelTotal = value; OnPropertyChanged(nameof(CutLevelTotal)); } }
public string SymLevelTotal { get { return _symLevelTotal; } set { _symLevelTotal = value; OnPropertyChanged(nameof(SymLevelTotal)); } }
@ -1015,6 +1018,8 @@ public class GradingResultVM : BaseViewModel
row.MinIndex = 7;
row.CutLevel = data != null ? data.CutLevel : "";
row.SymLevel = GetGradeName(data != null ? data.SymLevel??0 : 0);
this.SelRowDataDetail = row;
return row;
}

@ -28,7 +28,7 @@
<Setter.Value>
<Style TargetType="DataGridRow">
<!-- 行背景色, 包括选中、鼠标悬浮等情况下也都能看到基本色 -->
<Setter Property="Background" Value="#f0f1f6"/>
<!-- <Setter Property="Background" Value="#f0f1f6"/> -->
<Setter Property="Height" Value="50"/>
<!-- 行下方留 2 像素空隙,相当于“行间距” -->
<Setter Property="Margin" Value="0,3,0,3"/>
@ -58,6 +58,8 @@
<Setter Property="CellStyle">
<Setter.Value>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<!-- 同样可以在此修改单元格的边框、前景色等 -->

@ -32,6 +32,7 @@ public partial class MessageBox : Window
CancelButton.Visibility = Visibility.Hidden;
Grid.SetColumn(ConfirmButton, 2);
TextBlockCenterBox.Text = message;
System.Media.SystemSounds.Asterisk.Play();
_showType = 0;
this.Height = 200;
if (!string.IsNullOrWhiteSpace(btnStr))
@ -51,6 +52,7 @@ public partial class MessageBox : Window
Grid.SetRow(GridButtons, 2);
_showType = 1;
this.Height = 250;
System.Media.SystemSounds.Asterisk.Play();
TextBlockCenterBox.Text = message;
if (!string.IsNullOrWhiteSpace(confirmButtonTitle) && !string.IsNullOrWhiteSpace(cancelButtonTitle))
{
@ -70,7 +72,7 @@ public partial class MessageBox : Window
public MessageBoxResult ShowInput(String message, out String inputStr , String confirmButtonTitle = "", String cancelButtonTitle ="")
{
_showType = 2;
this.Height = 350;
this.Height = 300;
TextBlockCenterBox.Text = message;
if (!string.IsNullOrWhiteSpace(confirmButtonTitle) && !string.IsNullOrWhiteSpace(cancelButtonTitle))
{

@ -34,6 +34,7 @@
<Style x:Key="CustomDataGridCellStyle" TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
@ -258,13 +259,14 @@
Background="Transparent"
BorderThickness="0"
GridLinesVisibility="None"
FocusVisualStyle="{x:Null}"
IsReadOnly="True"
RowStyle="{StaticResource CustomDataGridRowStyle}"
ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
CellStyle="{StaticResource CustomDataGridCellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn Header="" Width="*" >
<DataGridTemplateColumn Header="" Width="2*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
@ -279,7 +281,7 @@
Visibility="Collapsed"
VerticalOffset="20"
HorizontalOffset="80">
<Border Width="1200" Height="100" Background="White" CornerRadius="5">
<Border Width="1500" Height="130" Background="White" CornerRadius="5" BorderThickness="1" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
@ -290,205 +292,234 @@
Background="Transparent" BorderThickness="0">
<Image Source="pack://application:,,,/Resource/Images/UIResource/01-8.png" MouseLeave="UIElement_OnMouseLeave" MouseEnter="UIElement_OnMouseEnter" Width="30" />
</Button>
<!-- <Grid Grid.Row="1"> -->
<!-- <Grid.ColumnDefinitions> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- <ColumnDefinition Width="Auto"/> -->
<!-- </Grid.ColumnDefinitions> -->
<!-- -->
<!-- </Grid> -->
<Grid Grid.Row="1">
<DataGrid x:Name="RowDetail" CanUserResizeColumns="False" CanUserResizeRows="False" FontSize="16">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Resources>
<Style x:Key="CenteredTextBlockStyle" TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
</Style>
<Style x:Key="OtherCellkStyle" TargetType="DataGridCell">
<Setter Property="Background" Value="#bbbbbb"/>
<Setter Property="BorderBrush" Value="#ededed"/>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Width="2*" Header="" Binding="{Binding itemName}" ElementStyle="{StaticResource CenteredTextBlockStyle}">
<DataGridTextColumn.CellStyle >
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="#ededed"/>
<Setter Property="BorderBrush" Value="#ededed"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="{DynamicResource resAvg}" Binding="{Binding Avg}" ElementStyle="{StaticResource CenteredTextBlockStyle}" CellStyle="{StaticResource OtherCellkStyle}"/>
<DataGridTextColumn Width="*" Header="{DynamicResource resDev}" Binding="{Binding Dev}" ElementStyle="{StaticResource CenteredTextBlockStyle}" CellStyle="{StaticResource OtherCellkStyle}"/>
<DataGridTextColumn Width="*" Header="{DynamicResource resMin}" Binding="{Binding Min}" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Width="*" Header="{DynamicResource resMax}" Binding="{Binding Max}" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Width="*" Header="1" Binding="{Binding item1}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="0">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="0">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="2" Binding="{Binding item2}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="1">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="1">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="3" Binding="{Binding item3}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="2">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="2">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="4" Binding="{Binding item4}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="3">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="3">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="5" Binding="{Binding item5}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="4">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="4">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="6" Binding="{Binding item6}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="5">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="5">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="7" Binding="{Binding item7}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="6">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="6">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="8" Binding="{Binding item8}" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding MaxIndex}" Value="7">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding MinIndex}" Value="7">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="*" Header="{DynamicResource CutLevel}" Binding="{Binding CutLevel}" ElementStyle="{StaticResource CenteredTextBlockStyle}" CellStyle="{StaticResource OtherCellkStyle}"/>
<DataGridTextColumn Width="*" Header="{DynamicResource resLevel}" Binding="{Binding SymLevel}" ElementStyle="{StaticResource CenteredTextBlockStyle}" CellStyle="{StaticResource OtherCellkStyle}"/>
</DataGrid.Columns>
</DataGrid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="Transparent" Width="120" Height="80" CornerRadius="10" Margin="0 0 10 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.itemName}"
FontSize="22" Foreground="Black" FontWeight="Bold" TextWrapping="Wrap" Margin="0 0 0 5"/>
</Grid>
</Border>
<Border Grid.Column="1" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="{StaticResource DiamondResultGridAvgValue}"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.Avg}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="2" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="{StaticResource DiamondResultGridDeviationValue}"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.Dev}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="3" Background="#EBEEF5" Width="100" Height="80" CornerRadius="10" Margin="0 0 10 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="{StaticResource DiamondResultGridMaxValue}"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.Max}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="4" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="{StaticResource DiamondResultGridMinValue}"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.Min}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="13" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="{StaticResource DiamondResultGridCutLevel}"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.CutLevel}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="14" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="{StaticResource DiamondResultGridSymLevel}"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.SymLevel}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="5" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="1"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item1}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="6" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="2"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item2}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="7" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="3"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item3}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="8" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="4"
FontSize="18" Foreground="Black" Margin="0 0 0 5"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item4}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="9" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="5"
FontSize="18" Foreground="Black" Margin="0 0 0 6"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item5}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="10" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="6"
FontSize="18" Foreground="Black" Margin="0 0 0 6"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item6}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="11" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 5 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="7"
FontSize="18" Foreground="Black" Margin="0 0 0 6"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item7}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
<Border Grid.Column="12" Background="#EBEEF5" Width="90" Height="80" CornerRadius="10" Margin="0 0 0 0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center" Text="8"
FontSize="18" Foreground="Black" Margin="0 0 0 6"/>
<TextBlock Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding SelRowDataDetail.item8}"
FontSize="20" Foreground="#0063FF"/>
</Grid>
</Border>
</Grid>
</Grid>
</Grid>
</Border>
</Popup>
@ -501,13 +532,13 @@
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!-- 第2~5列 -->
<DataGridTextColumn Header="平均值" Binding="{Binding Avg}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Header="偏差值" Binding="{Binding Dev}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Header="偏差值" Binding="{Binding Min}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Header="偏差值" Binding="{Binding Max}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Header="{StaticResource DiamondResultGridAvgValue}" Binding="{Binding Avg}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Header="{StaticResource DiamondResultGridDeviationValue}" Binding="{Binding Dev}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Header="{StaticResource DiamondResultGridMinValue}" Binding="{Binding Min}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<DataGridTextColumn Header="{StaticResource DiamondResultGridMaxValue}" Binding="{Binding Max}" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}"/>
<!-- 第6列 -->
<DataGridTextColumn Header="切工等级" Binding="{Binding CutLevel}" Width="*">
<DataGridTextColumn Header="{StaticResource DiamondResultGridCutLevel}" Binding="{Binding CutLevel}" Width="*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Blue"/>
@ -517,7 +548,7 @@
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<!-- 第五列:SYM等级,下拉框示例,可编辑 -->
<DataGridTemplateColumn Width="*" Header="{DynamicResource resLevel}">
<DataGridTemplateColumn Width="*" Header="{DynamicResource DiamondResultGridSymLevel}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
@ -531,7 +562,7 @@
Foreground="DarkSlateGray"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="150">
Width="120">
</ComboBox>
</DataTemplate>

@ -21,7 +21,6 @@ public partial class GradingResult
// 在Window最外层捕获鼠标点击,判断是否点击在Popup之外,如果是则关闭所有Popup
this.PreviewMouseLeftButtonDown += Window_PreviewMouseLeftButtonDown;
//DataContext = new GradingResultVM(null);
// this.Viewport3Dx.EffectsManager = new DefaultEffectsManager();
@ -195,11 +194,15 @@ public partial class GradingResult
var popup = parentGrid.FindName("RowPopup") as Popup;
if (popup == null) return;
popup.DataContext = this.DataContext;
// 先关闭所有已显示的 Popup
CloseAllPopups();
// 将此Popup记录到集合中,并打开
var oo = FindVisualParent<DataGridRow>(parentGrid);
if(oo == null) return;
var d = DataContext as GradingResultVM;
RowDetail rowDetail = d.getSelectData((oo.Item as DataInfo).TestItemId);
if (!_allPopups.Contains(popup))
{
_allPopups.Add(popup);

Loading…
Cancel
Save