Sic04/SicUI/Models/PMs/PMProcessView.xaml.cs

29 lines
925 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Windows.Controls;
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
using DataGridBeginningEditEventArgs = ExtendedGrid.Microsoft.Windows.Controls.DataGridBeginningEditEventArgs;
namespace SicUI.Models.PMs
{
/// <summary>
/// PMProcessView.xaml 的交互逻辑
/// </summary>
public partial class PMProcessView : UserControl
{
public PMProcessView()
{
InitializeComponent();
}
private void DgCustom_OnBeginningEdit(object sender, DataGridBeginningEditEventArgs e)
{
// 禁止编辑不显示数值的Cell或已经完成工艺的Step
if (e.Row.Item is RecipeStep step)
{
var param = step[e.Column.DisplayIndex];
if (e.Column.IsReadOnly || param.IsHideValue || param.Parent.IsProcessed)
e.Cancel = true;
}
}
}
}