public void Init() { EventDateViewModel.ClearDict(); h = session.Load <HealthRecord>(IntToGuid <HealthRecord>(1)); emptyH = session.Load <HealthRecord>(IntToGuid <HealthRecord>(71)); vm = EventDateViewModel.FromHr(h); }
public void EmptySetAge() { var vm = EventDateViewModel.FromHr(emptyH); vm.AtAge = 5; Assert.AreEqual(EventDateViewModel.ShowAs.AtAge, vm.FirstSet); }
public void EmptySetOffset() { var vm = EventDateViewModel.FromHr(emptyH); vm.Offset = 5; Assert.AreEqual(EventDateViewModel.ShowAs.Offset, vm.FirstSet); }
public void EmptySetToMonth() { var vm = EventDateViewModel.FromHr(emptyH); vm.to.Month = 5; Assert.AreEqual(EventDateViewModel.ShowAs.Date, vm.FirstSet); }
public void EmptySetUnit() { var vm = EventDateViewModel.FromHr(emptyH); vm.Unit = DateUnit.Month; Assert.IsTrue(vm.IsEmpty); Assert.AreEqual(null, vm.FirstSet); }
public DateEditorViewModel(HealthRecord hr) { Contract.Requires(hr != null); this.healthRecord = hr; hr.FromDate.PropertyChanged += FromDate_PropertyChanged; healthRecord.PropertyChanged += healthRecord_PropertyChanged; EventDate = EventDateViewModel.FromHr(healthRecord); EventDate.PropertyChanged += EventDateVm_PropertyChanged; DateSuggestions = new ObservableCollection <DateSuggestion>(); IsIntervalEditorOpened = hr.FromDate != hr.ToDate; SetupDateSuggsetions(); }
public ShortHealthRecordViewModel(HealthRecord hr) { Contract.Requires(hr != null); this.healthRecord = hr; patient = hr.GetPatient(); patient.PropertyChanged += patient_PropertyChanged; healthRecord.PropertyChanged += healthRecord_PropertyChanged; healthRecord.ItemsChanged += healthRecord_ItemsChanged; SyncCheckedAndSelected = true; EventDate = EventDateViewModel.FromHr(healthRecord); EventDate.PropertyChanged += (s, e) => { OnPropertyChanged(() => EventDateString); }; DropHandler = new DropTargetHandler(this); IsDropTargetEnabled = true; }