public AddPrescriptionViewModel() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPrescriptionComponent>(); this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); this.SearchCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<SearchDrugViewModel>(), () => this.CanSearch()); this.Prescriptions = new ObservableCollection<PrescriptionDto>(); this.Tags = new ObservableCollection<TagDto>(); this.CreationDate = DateTime.Today; }
public AddPrescriptionViewModel() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); this.SearchCommand = new RelayCommand(() => ViewService.Manager.ShowDialog <SearchDrugViewModel>(), () => this.CanSearch()); this.Prescriptions = new ObservableCollection <PrescriptionDto>(); this.Tags = new ObservableCollection <TagDto>(); this.CreationDate = DateTime.Today; }
public AddDrugTypeViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPrescriptionComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPrescriptionComponent>(); } this.SelectedTag = new TagDto(TagCategory.Drug); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); }
public AddDrugTypeViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); } this.SelectedTag = new TagDto(TagCategory.Drug); this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); }
public AddDrugViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); } this.Tags = new ObservableCollection <TagDto>(); this.SelectedDrug = new DrugDto(); this.SelectedDrug.Tag = null; this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); }
public AddDrugViewModel() { if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IPrescriptionComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPrescriptionComponent>(); } this.Tags = new ObservableCollection<TagDto>(); this.SelectedDrug = new DrugDto(); this.SelectedDrug.Tag = null; this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); }
/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> /// <param name="host">The host.</param> public WorkbenchViewModel() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); PluginContext.Host.PatientConnected += (sender, e) => this.FoundPrescriptions.Clear(); this.RemovePrescriptionDocumentCommand = new RelayCommand(() => this.RemovePrescriptionDocument(), () => this.SelectedPrescriptionDocument != null); this.RemovePrescriptionCommand = new RelayCommand(() => this.RemovePrescription(), () => this.SelectedPrescription != null); this.EditPrescriptionCommand = new RelayCommand(() => this.EditPrescription(), () => this.SelectedPrescription != null); this.StartCriteria = DateTime.Today.AddMonths(-6); this.EndCriteria = DateTime.Today.AddMonths(1); this.FoundPrescriptions = new ObservableCollection <PrescriptionDocumentDto>(); }
/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> /// <param name="host">The host.</param> public WorkbenchViewModel() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPrescriptionComponent>(); PluginContext.Host.PatientConnected += (sender, e) => this.FoundPrescriptions.Clear(); this.RemovePrescriptionDocumentCommand = new RelayCommand(() => this.RemovePrescriptionDocument(), () => this.SelectedPrescriptionDocument != null); this.RemovePrescriptionCommand = new RelayCommand(() => this.RemovePrescription(), () => this.SelectedPrescription != null); this.EditPrescriptionCommand = new RelayCommand(() => this.EditPrescription(), () => this.SelectedPrescription != null); this.StartCriteria = DateTime.Today.AddMonths(-6); this.EndCriteria = DateTime.Today.AddMonths(1); this.FoundPrescriptions = new ObservableCollection<PrescriptionDocumentDto>(); }
public SearchDrugViewModel() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); this.FoundDrugs = new ObservableCollection <DrugDto>(); this.Tags = new ObservableCollection <TagDto>(); this.SelectCommand = new RelayCommand(() => this.Select(), () => this.CanSelect()); this.SearchOnNameCommand = new RelayCommand(() => this.SearchOnName(), () => this.CanSearchOnName()); this.SearchOnTagCommand = new RelayCommand(() => this.SearchOnTag(), () => this.CanSearchOnTag()); Countdown.Elapsed += (sender, e) => PluginContext.Host.Invoke(() => { this.SearchOnNameCommand.TryExecute(); Countdown.Stop(); }); }
public SearchDrugViewModel() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPrescriptionComponent>(); this.FoundDrugs = new ObservableCollection<DrugDto>(); this.Tags = new ObservableCollection<TagDto>(); this.SelectCommand = new RelayCommand(() => this.Select(), () => this.CanSelect()); this.SearchOnNameCommand = new RelayCommand(() => this.SearchOnName(), () => this.CanSearchOnName()); this.SearchOnTagCommand = new RelayCommand(() => this.SearchOnTag(), () => this.CanSearchOnTag()); Countdown.Elapsed += (sender, e) => PluginContext.Host.Invoke(() => { this.SearchOnNameCommand.TryExecute(); Countdown.Stop(); }); }
public SearchPrescriptionViewModel() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPrescriptionComponent>(); this.SearchCommand = new RelayCommand(() => this.Search(), () => this.CanSearch()); }