using Prism.Mvvm;  // 引入 Prism 的 BindableBase
using System;
using System.Collections.ObjectModel;
using System.Linq;

namespace BOB.Models
{
    public class ProgramModel : BindableBase
    {
        #region 构造函数

        public ProgramModel()
        {
            // 可以进行初始化操作
        }

        public ProgramModel(ProgramModel source)
        {
            ID = source.ID;
            StepCollection = new ObservableCollection<StepModel>(source.StepCollection.Select(p => new StepModel(p)));
            Parameters = new ObservableCollection<ParameterModel>(source.Parameters.Select(p => new ParameterModel(p)));
        }

        #endregion

        public Guid ID { get; set; } = Guid.NewGuid();

        private ObservableCollection<StepModel> _stepCollection = new ObservableCollection<StepModel>();
        public ObservableCollection<StepModel> StepCollection
        {
            get => _stepCollection;
            set => SetProperty(ref _stepCollection, value);  // 使用 SetProperty 来处理属性更改
        }

        private ObservableCollection<ParameterModel> _parameters = new ObservableCollection<ParameterModel>();
        public ObservableCollection<ParameterModel> Parameters
        {
            get => _parameters;
            set => SetProperty(ref _parameters, value);
        }

       
    }
}
