private static void ReplaceIfThenElses(ControlConstructSchemeVM controlConstructScheme, Dictionary <IfThenElseVM, CreateBranchWindowVM> updatingIfThenElseDict) { Dictionary <IfThenElseVM, IfThenElseVM> ifThenElses = new Dictionary <IfThenElseVM, IfThenElseVM>(); foreach (KeyValuePair <IfThenElseVM, CreateBranchWindowVM> pair in updatingIfThenElseDict) { IfThenElseVM ifThenElse = pair.Key; CreateBranchWindowVM vm = pair.Value; vm.Save(); IfThenElseVM newIfThenElse = new IfThenElseVM(vm.IfThenElse); controlConstructScheme.ReplaceIfThenElse(ifThenElse, newIfThenElse); } }