コード例 #1
0
        public MainWindowViewModel()
        {
            phoneRecordsViewModel   = new PhoneRecordsViewModel(repo);
            addPhoneRecordViewModel = new AddPhoneRecordViewModel(repo);

            CurrentViewModel = phoneRecordsViewModel;

            phoneRecordsViewModel.AddRecordRequested  += NavToAddPhoneRecord;
            phoneRecordsViewModel.EditRecordRequested += NavToEditPhoneRecord;
            addPhoneRecordViewModel.Done += NavToViewAllRecords;
        }
コード例 #2
0
 private void NavToViewAllRecords(string errorMessage)
 {
     phoneRecordsViewModel.AddErrorMessage(errorMessage);
     phoneRecordsViewModel.SetSelectionToNull();
     CurrentViewModel = phoneRecordsViewModel;
 }
コード例 #3
0
 private void NavToEditPhoneRecord(PhoneRecord record)
 {
     addPhoneRecordViewModel.EditMode = true;
     addPhoneRecordViewModel.SetRecord(record);
     CurrentViewModel = addPhoneRecordViewModel;
 }