public void EditCommandExecuted(object parameter) { if (parameter != null) { Employee e = parameter as Employee; this._EditDialog = new EditDialog(); this._EditDialog.ResizeMode = ResizeMode.NoResize; this._EditDialog.DataContext = new EmployeeEditorViewModel(e, this.OKCommand, this.CancelCommand); this.EditedEmployee = e; this.EmployeesBackUp = new Employee { FirstName = e.FirstName, LastName = e.LastName, Occupation = e.Occupation, Address = e.Address, City = e.City, Country = e.Country, Phone = e.Phone, Photo = e.Photo }; this._EditDialog.ShowDialog(); } }
public EmployeeEditorViewModel(Employee employee, ICommand okCommand, ICommand cancelCommand) { this.Employee = employee; this.OKCommand = okCommand; this.CancelCommand = cancelCommand; }