feat:切工仪样式调整

master
sunhonglei 7 months ago
parent 8365ca1792
commit 35daa33cc2
  1. 2
      Language/zh_CN.xaml
  2. 5
      ViewModel/Configuration/CutConfigVM.cs
  3. 59
      Views/Configuration/CutConfigPage.xaml

@ -18,7 +18,7 @@
<sys:String x:Key="ImportModel">导入模板</sys:String> <sys:String x:Key="ImportModel">导入模板</sys:String>
<sys:String x:Key="Save">更新保存</sys:String> <sys:String x:Key="Save">更新保存</sys:String>
<sys:String x:Key="AddRow">添加5行</sys:String> <sys:String x:Key="AddRow">添加行</sys:String>
<sys:String x:Key="AlgorithmConfig">算法配置</sys:String> <sys:String x:Key="AlgorithmConfig">算法配置</sys:String>
<sys:String x:Key="LevelConfig">定级配置</sys:String> <sys:String x:Key="LevelConfig">定级配置</sys:String>

@ -61,10 +61,7 @@ public class CutConfigVM: BaseViewModel
/// <param name="row">行数</param> /// <param name="row">行数</param>
public void AddRows(object row) public void AddRows(object row)
{ {
for (int i = 0;i<5;i++) CutterInfos.Rows.Add("", "", "",Guid.NewGuid(), RowNo++);
{
CutterInfos.Rows.Add("", "", "",Guid.NewGuid(), RowNo++);
}
} }
/// <summary> /// <summary>

@ -64,10 +64,11 @@
AutoGenerateColumns="False" AutoGenerateColumns="False"
CanUserAddRows="False"> CanUserAddRows="False">
<DataGrid.Resources> <DataGrid.Resources>
<Style x:Key="CenteredTextBlockStyle" TargetType="TextBlock"> <Style x:Key="CenteredTextBlockStyle" TargetType="TextBox">
<Setter Property="TextAlignment" Value="Center"/> <Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="Black"/>
</Style> </Style>
</DataGrid.Resources> </DataGrid.Resources>
<DataGrid.ColumnHeaderStyle> <DataGrid.ColumnHeaderStyle>
@ -100,13 +101,55 @@
</Style> </Style>
</DataGrid.RowStyle> </DataGrid.RowStyle>
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="项目名称" Width="2*" ElementStyle="{StaticResource CenteredTextBlockStyle}" <DataGridTemplateColumn Header="项目名称" Width="2*" >
Binding="{Binding ItemName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" <DataGridTemplateColumn.CellTemplate>
/> <DataTemplate>
<DataGridTextColumn Header="Key" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}" <TextBlock Text="{Binding ItemName}"
Binding="{Binding Key, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> Foreground="Black"
<DataGridTextColumn Header="Value" Width="*" ElementStyle="{StaticResource CenteredTextBlockStyle}" TextAlignment="Center"
Binding="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text="{Binding ItemName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MaxLength="50"
Foreground="Black" Style="{StaticResource CenteredTextBlockStyle}">
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Key" Width="*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Key}"
Foreground="Black"
TextAlignment="Center"
VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text="{Binding Key, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MaxLength="50" Style="{StaticResource CenteredTextBlockStyle}">
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Value" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value}"
Foreground="Black"
TextAlignment="Center"
VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MaxLength="50" Style="{StaticResource CenteredTextBlockStyle}">
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="操作" Width="*"> <DataGridTemplateColumn Header="操作" Width="*">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>

Loading…
Cancel
Save