2 Коміти a95102b65a ... 3a782cc753

Автор SHA1 Опис Дата
  宝臣 王 3a782cc753 Merge branch 'master' of https://git.xxb.lttc.cn/wangbc/UniformMaterialManagementSystem 3 місяців тому
  宝臣 王 2ab6f3a6ee 优化行序号显示方式 3 місяців тому

+ 13 - 2
UniformMaterialManagementSystem.FilterDataGrid/FilterDataGrid.cs

@@ -510,8 +510,7 @@ namespace FilterDataGrid
                     };
 
                     txt.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
-                    RowHeaderWidth = Math.Max(Math.Ceiling(txt.DesiredSize.Width),
-                        RowHeaderWidth >= 0 ? RowHeaderWidth : 0);
+                    RowHeaderWidth = Math.Max(Math.Ceiling(txt.DesiredSize.Width) + 3, RowHeaderWidth >= 0 ? RowHeaderWidth : 0);
                 }
                 else
                 {
@@ -556,6 +555,18 @@ namespace FilterDataGrid
         protected override void OnLoadingRow(DataGridRowEventArgs e)
         {
             e.Row.Header = (e.Row.GetIndex() + 1).ToString();
+
+            var txt = new TextBlock
+            {
+                Text = ItemsSourceCount.ToString(),
+                FontSize = FontSize,
+                FontFamily = FontFamily,
+                Padding = new Thickness(0, 0, 4, 0),
+                Margin = new Thickness(2.0)
+            };
+
+            txt.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
+            RowHeaderWidth = Math.Max(Math.Ceiling(txt.DesiredSize.Width) + 3, RowHeaderWidth >= 0 ? RowHeaderWidth : 0);
         }
 
         #endregion Protected Methods

+ 4 - 4
UniformMaterialManagementSystem.FilterDataGrid/Loc.cs

@@ -188,13 +188,13 @@ namespace FilterDataGrid
                 { TranslatableElements.Clear, "清除过滤器 \"{0}\"" },
                 { TranslatableElements.Contains, "搜索(包含)" },
                 { TranslatableElements.StartsWith, "搜索 (来自)" },
-                { TranslatableElements.Toggle, "切換包含/開始於" },
+                { TranslatableElements.Toggle, "切换包含/开始于" },
                 { TranslatableElements.Ok, "确定" },
                 { TranslatableElements.Cancel, "取消" },
-                { TranslatableElements.Status, "{0:n0} 找到了 {1:n0} 条记录" },
+                { TranslatableElements.Status, "从 {1:n0} 中记录中找到了 {0:n0} 条" },
                 { TranslatableElements.ElapsedTime, "经过时间{0:mm}:{0:ss}.{0:ff}" },
-                { TranslatableElements.True, "已中" },
-                { TranslatableElements.False, "未中" },
+                { TranslatableElements.True, "已中" },
+                { TranslatableElements.False, "未中" },
                 { TranslatableElements.RemoveAll, "删除所有过滤器" },
                 { TranslatableElements.Indeterminate, "不定" },
             });

+ 22 - 2
UniformMaterialManagementSystem/Views/ContractPage.xaml

@@ -97,9 +97,29 @@
         <Style x:Key="CustomRowHeaderStyle" TargetType="DataGridRowHeader">
             <Setter Property="Background" Value="White" />
             <Setter Property="Foreground" Value="Black" />
-            <Setter Property="BorderThickness" Value="0,0,1,1" />
-            <Setter Property="BorderBrush" Value="LightSlateGray" />
+            <Setter Property="HorizontalContentAlignment" Value="Center" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="DataGridRowHeader">
+                        <Grid>
+                            <Border
+                                Width="{TemplateBinding Width}"
+                                Background="Transparent"
+                                BorderBrush="Gray"
+                                BorderThickness="0,0,1,1">
+                                <ContentPresenter
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Content="{TemplateBinding Content}"
+                                    ContentTemplate="{TemplateBinding ContentTemplate}" />
+                            </Border>
+                        </Grid>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
         </Style>
+
         <Style x:Key="CustomRowStyle" TargetType="DataGridRow">
             <Setter Property="Background" Value="White" />
             <Setter Property="FontSize" Value="13" />