public DesignRoomItemViewModel() { this.Name = "406"; this.Title = "Room " + this.Name; var svc = new DesignSessionService(); svc.Load(); var vms = new ObservableCollection<SessionItemViewModel>(); svc.Data.Where(s=> s.Room == this.Name).ForEach(s => vms.Add(new SessionItemViewModel(s))); this.Sessions = vms; }
public DesignSessionItemViewModel() { //ObjectFactory.Get<ISessionsService>() var svc = new DesignSessionService(); svc.Load(); // consider automapper for wp7 (not out of beta?) var item = svc.Data.FirstOrDefault(); SessionItemMapper.FillViewModel(this, item); var spSvc = new DesignSpeakersService(); spSvc.Load(); var speakerModel = spSvc.Data.FirstOrDefault(); this.Speaker = new SpeakerItemViewModel(); this.SpeakerName = speakerModel.Name; SpeakerItemMapper.FillViewModel(this.Speaker, speakerModel); }
public void LoadData() { var sessionSvc = new DesignSessionService(); sessionSvc.AfterCompleted = (e) => { this.Sessions = new List<SessionItemViewModel>(); //throw new Exception("count is : " + sessionSvc.Data.Count()); sessionSvc.Data.ForEach(s => this.Sessions.Add(new SessionItemViewModel(s))); }; sessionSvc.Load(); var speakerSvc = new DesignSpeakersService(); speakerSvc.AfterCompleted = (e) => { this.Speakers = new List<SpeakerItemViewModel>(); speakerSvc.Data.ForEach(sp => this.Speakers.Add(new SpeakerItemViewModel(sp))); }; speakerSvc.Load(); }