public MainWindowViewModel() { phoneRecordsViewModel = new PhoneRecordsViewModel(repo); addPhoneRecordViewModel = new AddPhoneRecordViewModel(repo); CurrentViewModel = phoneRecordsViewModel; phoneRecordsViewModel.AddRecordRequested += NavToAddPhoneRecord; phoneRecordsViewModel.EditRecordRequested += NavToEditPhoneRecord; addPhoneRecordViewModel.Done += NavToViewAllRecords; }
private void NavToViewAllRecords(string errorMessage) { phoneRecordsViewModel.AddErrorMessage(errorMessage); phoneRecordsViewModel.SetSelectionToNull(); CurrentViewModel = phoneRecordsViewModel; }
private void NavToEditPhoneRecord(PhoneRecord record) { addPhoneRecordViewModel.EditMode = true; addPhoneRecordViewModel.SetRecord(record); CurrentViewModel = addPhoneRecordViewModel; }