private void newGroupbtn_Click(object sender, EventArgs e) { using (NewGroupWindow ngw = new NewGroupWindow()) { ngw.ShowDialog(this.TopLevelControl); } refreshtables(); }
public VMnewGroup(NewGroupWindow parent, List <string> existingNames) { this.name = string.Empty; this.parent = parent; this.existingNames = existingNames; this.CommandOk = new DelegateCommand(this.Ok, this.CanOk); this.CommandTextChanged = new DelegateCommand <object>(this.TextChanged); }
private void AddGroup() { var window = new NewGroupWindow(); var vmWindow = new VMnewGroup(window, new List <string>( from contract in this.Root.Contracts select contract.Name)); window.DataContext = vmWindow; if (window.ShowDialog() == true) { this.Root.Contracts.Add(new ContractModel(vmWindow.Name)); } }