public DesignSpeakerItemViewModel()
        {
            var svc = new DesignSpeakersService();
            svc.Load();

            var item = svc.Data.Skip(1).FirstOrDefault();

            SpeakerItemMapper.FillViewModel(this, item);
        }
        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);
        }
Ejemplo n.º 3
0
        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();
        }