public void SetViewModel(TimelineModel t) { if (t.EventModels != null) { foreach (EventModel e in t.EventModels) { EventViewModel vm = new EventViewModel(); vm.SetViewModel(e); this.ListOfEvents.Add(vm); } } this.Theme = Theme.GetThemeByID(t.ThemeID); this.Title = t.Title; }
public TimelineModel ConvertToSaveModel() { TimelineModel t = new TimelineModel(); t.EventModels = new List <EventModel>(); foreach (EventViewModel e in this.ListOfEvents) { t.EventModels.Add(e.ConvertToSaveModel()); } t.ThemeID = this.Theme.ID; t.Title = this.Title; return(t); }