桌面端快检记录新增列表及同步mes
This commit is contained in:
@@ -62,6 +62,9 @@ public partial class RubberQuickTestOperationView : UserControl
|
||||
var vm = _vm ?? DataContext as RubberQuickTestOperationViewModel;
|
||||
if (vm == null) return;
|
||||
|
||||
var centerTextStyle = (Style)FindResource("DataGridCellCenterTextStyle");
|
||||
var centerEditStyle = (Style)FindResource("DataGridCellCenterEditStyle");
|
||||
|
||||
InspectResultGrid.Columns.Clear();
|
||||
|
||||
InspectResultGrid.Columns.Add(new DataGridTextColumn
|
||||
@@ -72,7 +75,8 @@ public partial class RubberQuickTestOperationView : UserControl
|
||||
Mode = BindingMode.OneWay
|
||||
},
|
||||
IsReadOnly = true,
|
||||
Width = 80
|
||||
Width = 80,
|
||||
ElementStyle = centerTextStyle
|
||||
});
|
||||
|
||||
for (int i = 0; i < vm.DataPointColumns.Count; i++)
|
||||
@@ -83,17 +87,23 @@ public partial class RubberQuickTestOperationView : UserControl
|
||||
? $"数据点{columnIndex + 1}"
|
||||
: col.PointName;
|
||||
|
||||
var valueBinding = new Binding($"Cells[{columnIndex}].Value")
|
||||
{
|
||||
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
|
||||
Mode = vm.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay,
|
||||
TargetNullValue = string.Empty
|
||||
};
|
||||
if (vm.IsReadOnly)
|
||||
valueBinding.StringFormat = "N2";
|
||||
|
||||
InspectResultGrid.Columns.Add(new DataGridTextColumn
|
||||
{
|
||||
Header = header,
|
||||
Binding = new Binding($"Cells[{columnIndex}].Value")
|
||||
{
|
||||
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
|
||||
Mode = BindingMode.TwoWay,
|
||||
TargetNullValue = string.Empty
|
||||
},
|
||||
Binding = valueBinding,
|
||||
Width = 100,
|
||||
IsReadOnly = false
|
||||
IsReadOnly = vm.IsReadOnly,
|
||||
ElementStyle = centerTextStyle,
|
||||
EditingElementStyle = centerEditStyle
|
||||
});
|
||||
}
|
||||
|
||||
@@ -105,7 +115,8 @@ public partial class RubberQuickTestOperationView : UserControl
|
||||
Mode = BindingMode.OneWay
|
||||
},
|
||||
IsReadOnly = true,
|
||||
Width = 90
|
||||
Width = 90,
|
||||
ElementStyle = centerTextStyle
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user