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