2023-05-10 16:21:45 +08:00
|
|
|
|
using System.Collections.Generic;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
using System.Collections.ObjectModel;
|
2023-05-10 16:21:45 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
2023-05-10 16:21:45 +08:00
|
|
|
|
namespace MECF.Framework.UI.Client.RecipeEditorLib.DGExtension.CustomColumn
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
public class MultipleSelectColumn : EditorDataGridTemplateColumnBase
|
|
|
|
|
{
|
|
|
|
|
public MultipleSelectColumn() : base()
|
|
|
|
|
{
|
|
|
|
|
this.Options = new ObservableCollection<Option>();
|
|
|
|
|
}
|
|
|
|
|
public class Option
|
|
|
|
|
{
|
|
|
|
|
public MultipleSelectParam parent { get; set; }
|
|
|
|
|
|
|
|
|
|
public string ControlName { get; set; }
|
|
|
|
|
public string DisplayName { get; set; }
|
|
|
|
|
public string RelatedParameters { get; set; }
|
2023-06-15 19:19:41 +08:00
|
|
|
|
|
2023-04-13 11:51:03 +08:00
|
|
|
|
public bool IsChecked
|
|
|
|
|
{
|
|
|
|
|
get { return this.isChecked; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
this.isChecked = value;
|
2023-06-15 19:19:41 +08:00
|
|
|
|
if (this.parent != null)
|
2023-04-13 11:51:03 +08:00
|
|
|
|
this.parent.IsSaved = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool isChecked;
|
|
|
|
|
}
|
|
|
|
|
public ObservableCollection<Option> Options { get; set; }
|
|
|
|
|
public List<Option> CloneOptions(MultipleSelectParam _parent = null)
|
|
|
|
|
{
|
|
|
|
|
List<Option> opts = new List<Option>();
|
|
|
|
|
this.Options.ToList().ForEach(opt =>
|
|
|
|
|
{
|
|
|
|
|
opts.Add(new Option()
|
|
|
|
|
{
|
|
|
|
|
parent = _parent,
|
|
|
|
|
ControlName = opt.ControlName,
|
|
|
|
|
DisplayName = opt.DisplayName,
|
|
|
|
|
RelatedParameters = opt.RelatedParameters
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return opts;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|