private void AddNewAccountExecuted() { var clientVM = new ClientEditorViewModel(); var clientWindow = new ClientEditorWindow(); clientWindow.DataContext = clientVM; clientVM.Saved += clientWindow.Close; clientVM.Rejected += clientWindow.Close; clientWindow.Show(); }
private void EditClientExecuted(Client client) { var clientVM = new ClientEditorViewModel(SelectedClient); var clientWindow = new ClientEditorWindow(); var onClose = new Action(() => { clientWindow.Close(); clientVM.StopListen(); }); clientWindow.DataContext = clientVM; clientVM.Rejected += onClose; clientVM.Saved += onClose; clientWindow.Show(); }