/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> public WorkbenchViewModel() { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); this.Reputations = new ObservableCollection<ReputationDto>(); this.Professions = new ObservableCollection<ProfessionDto>(); this.Insurances = new ObservableCollection<LightInsuranceDto>(); this.Practices = new ObservableCollection<LightPracticeDto>(); this.Doctors = new ObservableCollection<LightDoctorDto>(); this.SearchTags = new ObservableCollection<SearchTagDto>(); this.Genders = new ObservableCollection<Tuple<string, Gender>>(); Genders.Add(new Tuple<string, Gender>(Messages.Male, Gender.Male)); Genders.Add(new Tuple<string, Gender>(Messages.Female, Gender.Female)); this.sendPrivateMailCommand = new RelayCommand(() => this.SendMail(this.SelectedPatient.PrivateMail), () => this.CanSendMail()); this.sendProMailCommand = new RelayCommand(() => SendMail(this.SelectedPatient.ProMail), () => this.CanSendMail()); this.saveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); this.changeImageCommand = new RelayCommand(() => this.ChangeImage(), () => this.CanChangeImage()); this.deactivateCommand = new RelayCommand(() => this.Deactivate(), () => this.CanDeactivate()); this.setSelectedDoctorCommand = new RelayCommand(() => this.SetSelectedDoctor(), () => this.CanSetSelectedDoctor()); this.refreshTagsCommand = new RelayCommand(() => this.RefreshTags(), () => this.CanRefreshTags()); PluginDataContext.Instance.DoctorBinded += (sender, e) => this.Doctors.Add(e.Data); PluginDataContext.Instance.DoctorUnbinded += (sender, e) => { var thisDoctor = (from d in this.Doctors where d.Id == e.Data.Id select d).FirstOrDefault(); if (thisDoctor == null) { return; } this.Doctors.Remove(thisDoctor); }; }
public AddSpecialisationViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); } this.Tag = new TagDto(TagCategory.Doctor); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); }
public AddSpecialisationViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); } this.Tag = new TagDto(TagCategory.Doctor); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); }
public InsertionViewModel() { this.HasInsertedItem = false; this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); } }
public InsertionViewModel() { this.HasInsertedItem = false; this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); } }
public AddProfessionViewModel() { this.Profession = new ProfessionDto(); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); } }
public AddProfessionViewModel() { this.Profession = new ProfessionDto(); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); } }
public AddPracticeViewModel() { this.Practice = new PracticeDto(); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); this.ShowPopupCommand = new RelayCommand(() => this.IsPopupOpened = true); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); } }
public AddPracticeViewModel() { this.Practice = new PracticeDto(); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); this.ShowPopupCommand = new RelayCommand(() => this.IsPopupOpened = true); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); } }
public override void Initialise() { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserDisconnecting -= Host_Disconnecting; PluginContext.Host.UserDisconnecting += Host_Disconnecting; PluginContext.Host.Invoke(() => { this.ConfigureViewService(); this.BuildButtons(); this.BuildContextMenu(); }); }
public AddDoctorViewModel() { this.InitialiseCollections(); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); } this.Doctor = new DoctorDto(); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); this.Refresh(); }
public AddDoctorViewModel() { this.InitialiseCollections(); if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); } this.Doctor = new DoctorDto(); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); this.Refresh(); }
/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> /// <param name="host">The host.</param> public WorkbenchViewModel() : base() { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); this.InitialiseCollections(); this.ChangeImageCommand = new RelayCommand(() => this.ChangeImage(), () => this.CanChangePicture()); this.BindDoctorCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<BindDoctorViewModel>(), () => this.Patient != null); this.RemoveLinkCommand = new RelayCommand(() => this.RemoveLink()); this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); }
/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> /// <param name="host">The host.</param> public WorkbenchViewModel() : base() { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); this.InitialiseCollections(); this.ChangeImageCommand = new RelayCommand(() => this.ChangeImage(), () => this.CanChangePicture()); this.BindDoctorCommand = new RelayCommand(() => ViewService.Manager.ShowDialog <BindDoctorViewModel>(), () => this.Patient != null); this.RemoveLinkCommand = new RelayCommand(() => this.RemoveLink()); this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); }
public BindDoctorViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); } this.FoundDoctors = new ObservableCollection <LightDoctorDto>(); this.SearchCommand = new RelayCommand(() => this.Search(), () => this.CanSearch()); this.SelectDoctorCommand = new RelayCommand(() => this.SelectDoctor(), () => this.CanSelectDoctor()); Countdown.Elapsed += (sender, e) => PluginContext.Host.Invoke(() => { this.SearchCommand.TryExecute(); Countdown.Stop(); }); }
public BindDoctorViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>(); } this.FoundDoctors = new ObservableCollection<LightDoctorDto>(); this.SearchCommand = new RelayCommand(() => this.Search(), () => this.CanSearch()); this.SelectDoctorCommand = new RelayCommand(() => this.SelectDoctor(), () => this.CanSelectDoctor()); Countdown.Elapsed += (sender, e) => PluginContext.Host.Invoke(() => { this.SearchCommand.TryExecute(); Countdown.Stop(); }); }
/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> public WorkbenchViewModel() { this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>(); this.Reputations = new ObservableCollection <ReputationDto>(); this.Professions = new ObservableCollection <ProfessionDto>(); this.Insurances = new ObservableCollection <LightInsuranceDto>(); this.Practices = new ObservableCollection <LightPracticeDto>(); this.Doctors = new ObservableCollection <LightDoctorDto>(); this.SearchTags = new ObservableCollection <SearchTagDto>(); this.Genders = new ObservableCollection <Tuple <string, Gender> >(); Genders.Add(new Tuple <string, Gender>(Messages.Male, Gender.Male)); Genders.Add(new Tuple <string, Gender>(Messages.Female, Gender.Female)); this.sendPrivateMailCommand = new RelayCommand(() => this.SendMail(this.SelectedPatient.PrivateMail), () => this.CanSendMail()); this.sendProMailCommand = new RelayCommand(() => SendMail(this.SelectedPatient.ProMail), () => this.CanSendMail()); this.saveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); this.changeImageCommand = new RelayCommand(() => this.ChangeImage(), () => this.CanChangeImage()); this.deactivateCommand = new RelayCommand(() => this.Deactivate(), () => this.CanDeactivate()); this.setSelectedDoctorCommand = new RelayCommand(() => this.SetSelectedDoctor(), () => this.CanSetSelectedDoctor()); this.refreshTagsCommand = new RelayCommand(() => this.RefreshTags(), () => this.CanRefreshTags()); PluginDataContext.Instance.DoctorBinded += (sender, e) => this.Doctors.Add(e.Data); PluginDataContext.Instance.DoctorUnbinded += (sender, e) => { var thisDoctor = (from d in this.Doctors where d.Id == e.Data.Id select d).FirstOrDefault(); if (thisDoctor == null) { return; } this.Doctors.Remove(thisDoctor); }; }
protected Action(IPatientDataComponent component, LightPatientDto patient) { this.Component = component; this.Patient = patient; }
protected DoctorAction(IPatientDataComponent component, LightPatientDto patient, LightDoctorDto doctor) : base(component, patient) { this.Doctor = doctor; }
public UnbindDoctorAction(IPatientDataComponent component, LightPatientDto patient, LightDoctorDto doctor) : base(component, patient, doctor) { }
public AddThumbnailAction(IPatientDataComponent component, LightPatientDto patient, byte[] thumbnail) : base(component, patient) { this.Thumbnail = thumbnail; }