public ScheduleViewModel() : base(registerCoreData:true) { SetBusy(true, "Do or do not... there is no try."); this.ChildViewModels = new Dictionary<string, ScheduleChildViewModel> { {MySchedule, IoC.Get<MyScheduleViewModel>()}, {Favorites, new MyFavoritesViewModel()}, {Time, new RightAboutNowViewModel()}, {StartingSoon, new StartingSoonViewModel()}, {Upcoming, new UpcomingViewModel()} }; this.ScheduleViews = new List<string>(this.ChildViewModels.Keys); this.ChildViewModels.Values.ForEach(l => l.SetViewModel(this)); _childViewModel = this.ChildViewModels[MySchedule]; //WithCoreDataPresent(Resume); this.InitialActivation = true; }
public void Restore(IDataStorage store) { // only want to restore if this is a tombstone scenario if (IoC.Get<IApp>().IsNewApp) { return; } _scheduleView = store.Restore(() => this.ScheduleView, MySchedule); _isMyScheduleView = store.Restore(() => this.IsMyScheduleView, true); _notFoundText = store.Restore(() => this.NotFoundText, _notFoundText); _sessionIds = store.Restore(() => this.SessionIds, null); _childViewModel = this.ChildViewModels[_scheduleView]; WithCoreDataPresent(Resume); }