private async void bootstrap() { setupMenuItems(); // need an option to show feeds for all kids var kidAll = new Student() { name = "All", feeds = new List<FeedItem>() }; List<Student> students = await getParentKids(Constants.parentId); students.Insert(0, kidAll); foreach (Student s in students) { // get feeds for each student if (s.id != null) { List<FeedItem> feeds = await getStudentFeeds(s.id); s.feeds = feeds; kidAll.feeds.AddRange(feeds); } Students.Add(s); } kidAll.feeds = kidAll.feeds.OrderByDescending(c=>c.Date).ToList(); App.listStudents = students; this.DefaultViewModel["selectedStudent"] = kidAll; }
public static Student mapJsonToStudent(JsonObject studentJson) { JsonObject name = studentJson.GetNamedObject("name"); Student s = new Student(); s.name = string.Format("{0} {1}", name.GetNamedString("firstName"),name.GetNamedString("lastSurname")); s.id = studentJson.GetNamedString("id"); return s; }