using System.Collections.ObjectModel; using System.Xml.Serialization; namespace WPFProject.Models { public class Sequence : NotifyBase { private string _Name; public string Name { get { return _Name; } set => RaiseAndSetIfChanged(ref _Name, value); } [XmlIgnore] public Program Program { get; set; } private ObservableCollection _Steps = new ObservableCollection() { new Step{ Name = "000"},new Step{ Name="111"} }; public ObservableCollection Steps { get { return _Steps; } set => RaiseAndSetIfChanged(ref _Steps, value); } public Sequence AddStep(params Step[] steps) { foreach (Step step in steps) { if (step == null) continue; step.Program = Program; Steps.Add(step); } return this; } public void Run() { foreach (Step step in Steps) { step.Run(); } } } }