public void SetSelectedQuestion(Question question) { this.CurrentPage = this.Children.Single(p => ((PartPage)p).GetPart().Id == question.part.Id); PartPage partPage = (PartPage)this.CurrentPage; partPage.CurrentPage = partPage.Children.Single(q => ((QuestionPage)q).question.Id == question.Id); }
public void SetSelectedQuestion(Question question) { this.CurrentPage = this.Children.Single(p => ((PartPage)p).GetPart().Id == question.part.Id); PartPage partPage = (PartPage)this.CurrentPage; ContentPage questionPage = partPage.Children.Single(q => ((QuestionPage)q).question.Id == question.Id); (questionPage as QuestionPage).Initialize(); partPage.CurrentPage = questionPage; }
public void Initialize() { if (!initialized) { initialized = true; foreach (SectionPart part in section.SectionParts) { PartPage page = new PartPage(part, inspection, this); Children.Add(page); } } }