[UI.Client]

优化Recipe保存时如果存在校验错误的参数,弹出的警告对话框的内容。
修正当RecipeEditor中某行权限设置为None时,拖拽填充时无法获取Cell对象导致引发NullReference异常的问题。
This commit is contained in:
Liang Su 2023-06-16 10:12:14 +08:00
parent a7051a3f1b
commit e10abebfe6
3 changed files with 10 additions and 4 deletions

View File

@ -1404,9 +1404,10 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
if (CurrentRecipe.Validate() == false)
{
var mbr = DialogBox.ShowDialog(
DialogButton.Yes | DialogButton.No,
DialogType.WARNING,
$"{CurrentRecipe.ValidationErrorSummary}\r\n Are you sure to continue to save?");
DialogButton.Yes | DialogButton.No,
DialogType.WARNING,
$"Are you sure to continue to save with errors?\r\n\r\n" +
$"{CurrentRecipe.ValidationErrorSummary}");
if (mbr == DialogButton.No)
return false;
}

View File

@ -211,6 +211,11 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.DGExtension
if (itemsHost.Children[i] is EGC.DataGridRow row)
{
var targetCell = row.TryGetCell(_selectionAnchor.Value.Column.DisplayIndex);
// 如果当前行被设置为Visibility.Collapsed则无法通过TryGetCell方法获取Cell对象
if(targetCell == null)
continue;
if (GetParamFromCell(targetCell) is IParam p)
p.SetValue(value);
}

View File

@ -41,7 +41,7 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel
public override string ToString()
{
return $"[Step{Step.StepNo}]-{Param.DisplayName} {Message}";
return $"[Step{Step.StepNo}][{Param.DisplayName}] {Message}";
}
#endregion