private void AddContract(object input) { var selectedContract = (input as VMcontractModel).Root; var window = new NewFunctionWindow(); var vmWindow = new VMnewFunction(window, new List <string>( from function in selectedContract.Functions select function.Name), new List <string>() { "Fill", "This", "List" }); window.DataContext = vmWindow; if (window.ShowDialog() == true) { selectedContract.Functions.Add(vmWindow.Function); } }
public VMnewFunction(NewFunctionWindow parent, List <string> existingNames, List <string> participants) { this.function = new Function(string.Empty, Function.ACCESSIBILITY.Public); this.parent = parent; this.existingNames = existingNames; this.participants = participants; this.CommandOk = new DelegateCommand(this.Ok, this.CanOk); this.CommandTextChanged = new DelegateCommand <object>(this.TextChanged); }