public VMconditionBase(ConditionBase root, VMcondition parent) : base(root, parent) { this.root = root; this.parent = parent; this.CommandRemove = new DelegateCommand(() => this.Parent.Root.Conditions.Remove(this.Root)); this.CommandSetLHS = new DelegateCommand(() => this.LHS = this.Parent.Parent.Parent.SelectVar()); this.CommandSetRHS = new DelegateCommand(() => this.RHS = this.Parent.Parent.Parent.SelectVar()); }
public VMconditionGroup(ConditionGroup root, VMcondition parent) : base(root, parent) { this.Wrap(); this.CommandAddSet = new DelegateCommand(this.Add); this.CommandRemoveSet = new DelegateCommand(this.Remove, this.CanRemove); this.CommandRemove = new DelegateCommand(() => this.Parent.Root.Groups.Remove(this.Root)); this.Root.Conditions.CollectionChanged += new NotifyCollectionChangedEventHandler(this.CollectionChanged); this.Root.Connectors.CollectionChanged += new NotifyCollectionChangedEventHandler(this.CollectionChanged); }