// Creating the record which will be validated and passing any record details if any (editing) public void SetRecord(PhoneRecord record) { if (EditablePhoneRecord != null) { EditablePhoneRecord.ErrorsChanged -= RaiseCanExecuteChanged; } EditablePhoneRecord = new EditableRecord(); EditablePhoneRecord.ErrorsChanged += RaiseCanExecuteChanged; CopyRecordDetails(record, EditablePhoneRecord); }
private void CopyRecordDetails(PhoneRecord sourceRecord, EditableRecord targetRecord) { if (EditMode) { targetRecord.PhoneRecordId = sourceRecord.PhoneRecordId; } targetRecord.Name = sourceRecord.Name; targetRecord.Surname = sourceRecord.Surname; targetRecord.PhoneNumber = sourceRecord.PhoneNumber; targetRecord.IdentificationNumber = sourceRecord.IdentificationNumber; }