void DoSelectStack(page_collection_wrapper collection) { PagesList = collection.PagesList; }
async Task LoadPages2(int loListIndex,bool images) { var lo_obj = LOsInCircle[loListIndex]; var LOID = lo_obj.lo.id; var sectionList = await _mLearningService.GetSectionsByLO (LOID); //var allSections = new ObservableCollection<LOsection>(); //Collection for transorming data var AllPagesList = new ObservableCollection<page_wrapper> (); //collections of collections var GroupedPagesList = new ObservableCollection<page_collection_wrapper>(); //For collection al pages var pagesList = new List<Page> (); foreach (var item in sectionList) { var sectionPages = await _mLearningService.GetPagesByLOSection (item.id); foreach (var page in sectionPages) { pagesList.Add (page); } var collectionWrapper = new page_collection_wrapper (); collectionWrapper.TagName = item.name; foreach (var p in sectionPages) { Mvx.Trace("Id: " + p.id); LOContent locontent = null; //LOContent locontent = new LOContent(); try { locontent = JsonConvert.DeserializeObject<LOContent> (p.content);//(locontentstring);; //locontent.lopage = JsonConvert.DeserializeObject<Lopage>(p.content); } catch(Exception e) { Mvx.Trace("Serialization error: "+e.Message); } var pw1 = new page_wrapper { page = p, content = locontent /*, id=pagecount*/ }; collectionWrapper.PagesList.Add (pw1); //AllPagesList.Add(pw1); pagecount++; } GroupedPagesList.Add (collectionWrapper); if (images) UpdatePagesImages (0, collectionWrapper.PagesList); } //if (images) // UpdatePagesImages(0, GroupedPagesList[i].PagesList); LOsInCircle[loListIndex].stack.StacksList = GroupedPagesList; LOsInCircle[loListIndex].stack.IsLoaded = true; LOCurrentIndex = loListIndex; UpdateExtraInfo(LOCurrentIndex); }
async Task LoadPages2(int loListIndex, bool images) { var lo_obj = LOsInCircle[loListIndex]; var LOID = lo_obj.lo.id; var sectionList = await _mLearningService.GetSectionsByLO(LOID); //var allSections = new ObservableCollection<LOsection>(); //Collection for transorming data var AllPagesList = new ObservableCollection <page_wrapper> (); //collections of collections var GroupedPagesList = new ObservableCollection <page_collection_wrapper>(); //For collection al pages var pagesList = new List <Page> (); foreach (var item in sectionList) { var sectionPages = await _mLearningService.GetPagesByLOSection(item.id); foreach (var page in sectionPages) { pagesList.Add(page); } var collectionWrapper = new page_collection_wrapper(); collectionWrapper.TagName = item.name; foreach (var p in sectionPages) { Mvx.Trace("Id: " + p.id); LOContent locontent = null; //LOContent locontent = new LOContent(); try { locontent = JsonConvert.DeserializeObject <LOContent> (p.content); //(locontentstring);; //locontent.lopage = JsonConvert.DeserializeObject<Lopage>(p.content); } catch (Exception e) { Mvx.Trace("Serialization error: " + e.Message); } var pw1 = new page_wrapper { page = p, content = locontent /*, id=pagecount*/ }; collectionWrapper.PagesList.Add(pw1); //AllPagesList.Add(pw1); pagecount++; } GroupedPagesList.Add(collectionWrapper); if (this.LOID == item.LO_id) { if (images) { UpdatePagesImages(0, collectionWrapper.PagesList); } } } //if (images) // UpdatePagesImages(0, GroupedPagesList[i].PagesList); LOsInCircle[loListIndex].stack.StacksList = GroupedPagesList; LOsInCircle[loListIndex].stack.IsLoaded = true; LOCurrentIndex = loListIndex; UpdateExtraInfo(LOCurrentIndex); }