protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string index = ""; if (NavigationContext.QueryString.TryGetValue("index", out index)) { DataContext = new SessionViewModel(App.Event.Sessions[int.Parse(index)]); } }
public AgendaItemViewModel(Model.AgendaItem item) { this.item = item; this.session = (from s in App.Event.Sessions where s.Id == item.SessionId select s).FirstOrDefault(); if (session != null) { Session = new SessionViewModel(session); var speaker = (from s in App.Event.Speakers where s.Name == session.Speaker select s).FirstOrDefault(); if (speaker != null) Speaker = new SpeakerViewModel(speaker, false); } }