public LicensesViewModel(Window view, FlowDocumentScrollViewer licenseReaderForQuilt, FlowDocumentScrollViewer licenseReaderDirectShowNet) { _licenseReaderForQuilt = licenseReaderForQuilt; _licenseReaderDirectShowNet = licenseReaderDirectShowNet; CloseViewCommand = new CloseViewCommand(view); view.Loaded += ViewOnLoaded; }
private void DoImport() { Logger.Info("DoImport: Storing settings"); UserSettings.UserSettings.Default.CsvPath = System.IO.Path.GetDirectoryName(FileName); Logger.Info("DoImport: Executing import"); Importer.Execute(); CloseViewCommand.Execute(null); }
private void DoOpenBackup(object param) { if (CanOpenBackup(null)) { Logger.Info("DoOpenBackup"); BackupFiles.LastSelected.OpenCommand.Execute(null); CloseViewCommand.Execute(null); } }
/// <summary> /// Clinicals the case changed event handler. /// </summary> /// <param name="obj">The <see cref="Rem.Ria.PatientModule.ClinicalCaseChangedEventArgs"/> instance containing the event data.</param> public void ClinicalCaseChangedEventHandler(ClinicalCaseChangedEventArgs obj) { Deployment.Current.InvokeIfNeeded( () => { ClearVisitInfo(); if (CloseViewCommand.CanExecute(null)) { CloseViewCommand.Execute(null); } }); }
private void HandleSaveRequestComplete(ReceivedResponses receivedResponses) { var response = receivedResponses.Get <DtoResponse <MedicationDto> > (); Medication = response.DataTransferObject; if (!Medication.HasErrors) { _eventAggregator.GetEvent <MedicationChangedEvent> ().Publish( new MedicationChangedEventArgs { Sender = this, MedicationKey = Medication.Key, PatientKey = Medication.PatientKey }); CloseViewCommand.Execute(null); } IsLoading = false; }
private void CopyProperty(object param) { if (CanCopyProperty(null)) { Logger.Info("CopyProperty: Copying property to clipboard, index = {0}", PreferredPropertyIndex); Properties[PreferredPropertyIndex].Copy(); CloseViewCommand.Execute(null); } else { Logger.Warn("CopyProperty: Cannot copy property"); if (Properties != null) { Logger.Warn("CopyProperty: Properties.Count = {0}, PreferredPropertyIndex = {1}", Properties.Count, PreferredPropertyIndex); } else { Logger.Warn("CopyProperty: Properties is null"); } } }
private void DoShowDonatePage() { System.Diagnostics.Process.Start(Properties.Settings.Default.DonateUrl); CloseViewCommand.Execute(null); }
private void DoShowWhatsNew() { System.Diagnostics.Process.Start(Properties.Settings.Default.WhatsNewUrl); CloseViewCommand.Execute(null); }
private void DoSaveShortcut() { _shortcut.KeySequence = _editedShortcut.KeySequence; _dirty = false; CloseViewCommand.Execute(null); }
public AboutViewModel(Window view) { CloseViewCommand = new CloseViewCommand(view); ShowLicensesCommand = new ShowViewCommand <LicensesView>(); }
private void OnSaveAndClose() { tasksRepository.Save(Task); CloseViewCommand.Execute(); }
private void OnSaveAndClose() { employeesRepository.Save(employee); CloseViewCommand.Execute(); }
/// <summary> /// Requests the completed. /// </summary> /// <param name="receivedResponses">The received responses.</param> protected override void RequestCompleted(ReceivedResponses receivedResponses) { IsLoading = false; base.RequestCompleted(receivedResponses); if (EditingDto.HasErrors) { var errors = EditingDto.GetErrors(null); var errorMessageSb = new StringBuilder(); foreach (DataErrorInfo dataErrorInfo in errors) { errorMessageSb.AppendLine(dataErrorInfo.ToString()); } errors = EditingDto.GetErrors(PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.PatientDocumentType)); foreach (DataErrorInfo dataErrorInfo in errors) { errorMessageSb.AppendLine(dataErrorInfo.ToString()); } errors = EditingDto.GetErrors( PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.OtherDocumentTypeName)); foreach (DataErrorInfo dataErrorInfo in errors) { errorMessageSb.AppendLine(dataErrorInfo.ToString()); } errors = EditingDto.GetErrors(PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.Description)); foreach (DataErrorInfo dataErrorInfo in errors) { errorMessageSb.AppendLine(dataErrorInfo.ToString()); } errors = EditingDto.GetErrors(PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.ClinicalStartDate)); foreach (DataErrorInfo dataErrorInfo in errors) { errorMessageSb.AppendLine(dataErrorInfo.ToString()); } errors = EditingDto.GetErrors( PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.ClinicalEndDate)); foreach (DataErrorInfo dataErrorInfo in errors) { errorMessageSb.AppendLine(dataErrorInfo.ToString()); } errors = EditingDto.GetErrors( PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.DocumentProviderName)); foreach (DataErrorInfo dataErrorInfo in errors) { errorMessageSb.AppendLine(dataErrorInfo.ToString()); } var errorMessage = errorMessageSb.ToString(); if (!string.IsNullOrWhiteSpace(errorMessage)) { _userDialogService.ShowDialog(errorMessage, "Save Mail Attachment to External Patient History", UserDialogServiceOptions.Ok); } } else { var patientDocumentUploadedEvent = new PatientDocumentUploadedEventArgs { PatientKey = EditingDto.PatientKey }; _eventAggregator.GetEvent <PatientDocumentUploadedEvent> ().Publish(patientDocumentUploadedEvent); _navigationService.Navigate( WorkspacesRegion, PatientWorkspaceView, "SubViewPassThrough", new[] { new KeyValuePair <string, string> ("PatientKey", Patient.Key.ToString()), new KeyValuePair <string, string> ("FullName", Patient.FullName), new KeyValuePair <string, string> ("SubViewName", ExternalPatientHistoryView) }); CloseViewCommand.Execute(null); } }