public void ResetHistory() { viewer = new HierViewer <Patient, Course, Appointment, IHrsHolder>( c => c.Patient, a => a.Course, p => p.GetOrderedCourses(), c => c.GetOrderedAppointments()); HrListViewModel.ResetHistory(); }
public CriteriaViewModel() { viewer = new HierViewer <Estimator, CriteriaGroup, Criterion, ICrit>( cg => cg.Estimator, cr => cr.Group, e => e.CriteriaGroups, cg => cg.Criteria ); Navigator = new CritNavigator(viewer, beforeInsert: CloseEditor); // first save editing crit Navigator.CurrentChanged += (s, e) => { var c = e.arg != null ? (e.arg as CriteriaItemViewModel).Crit : null; ShowEditor(c); }; Navigator.PropertyChanged += (s, e) => { if (e.PropertyName == "CurrentTitle") { Title = Navigator.CurrentTitle; } }; var ests = EntityQuery <Estimator> .All(Session)(); ests.ForEach(x => Navigator.AddRootItemFor(x)); emh.Add(this.Subscribe(Event.DeleteCrit, (e) => { var crit = e.GetValue <ICrit>(MessageKeys.Crit); DeleteCrit(crit); })); emh.Add(this.Subscribe(Event.EntityDeleted, (e) => { var entity = e.GetValue <IEntity>(MessageKeys.Entity); if (entity is ICrit) { OnCritDeleted(entity as ICrit); } })); //var last = ests.LastOrDefault(); //if (last != null) //{ // Open(last); //} }
public AbstractNavigatorViewModel(HierViewer <T1, T2, T3, I> viewer) { this.viewer = viewer; viewer.OpenedChanged += viewer_OpenedChanged; NoTopItems = true; TopItems = new ObservableCollection <TItem>(); TopItems.CollectionChanged += (s, e) => { NoTopItems = !TopItems.Any(); }; roots = new ObservableCollection <T1>(); roots.CollectionChanged += navigator_roots_CollectionChanged; NavigateToAdded = true; NavigateUpperOnRemoved = true; }
public CritNavigator(HierViewer<Estimator, CriteriaGroup, Criterion, ICrit> viewer, Action beforeInsert) : base(viewer) { this.beforeInsert = beforeInsert; NavigateUpperOnRemoved = false; }
public CardNavigator(HierViewer <Patient, Course, Appointment, IHrsHolder> viewer) : base(viewer) { }