예제 #1
0
        public InspectionPage(Inspection inspection)
        {
            this.inspection = inspection;
            Title           = inspection.Name;

            /*ToolbarItem scoreButton = new ToolbarItem();
             * scoreButton.Text = "Scores";
             * //scoreButton.Icon = "ScoresIcon.png";
             * scoreButton.Clicked += ClickScoresButton;
             *
             * ToolbarItem unansweredButton = new ToolbarItem();
             * unansweredButton.Text = "Unanswered";
             * unansweredButton.Clicked += ClickUnansweredButton;
             * ToolbarItem disputedButton = new ToolbarItem();
             * disputedButton.Text = "Disputed";
             * disputedButton.Clicked += ClickDisputedButton;
             *
             * ToolbarItem reportButton = new ToolbarItem();
             * reportButton.Text = "Report";
             * reportButton.Clicked += ClickReportButton;*/

            ToolbarItem actionsButton = new ToolbarItem();

            actionsButton.Text     = "Actions";
            actionsButton.Clicked += ClickActionsButton;

            //ToolbarItems.Add(scoreButton);
            //ToolbarItems.Add(unansweredButton);
            //ToolbarItems.Add(disputedButton);
            //ToolbarItems.Add(reportButton);
            ToolbarItems.Add(actionsButton);
            ChecklistModel checklist = inspection.Checklist;

            foreach (SectionModel section in checklist.Sections)
            {
                if (section.SectionParts.Count > 0)
                {
                    SectionWithPartsPage page = new SectionWithPartsPage(section, inspection, this);
                    Children.Add(page);
                }
                else
                {
                    SectionNoPartsPage page = new SectionNoPartsPage(section, inspection, this);
                    Children.Add(page);
                }
            }
            if (inspection.GetLastViewedQuestion() == null)
            {
                inspection.SetLastViewedQuestion(checklist.Sections.First().AllScorableQuestions().First());
            }
            this.CurrentPageChanged += this.PageChanged;
            Question     targetQuestion = inspection.GetLastViewedQuestion();
            ISectionPage targetPage     = SetSectionPage(targetQuestion.section);

            targetPage.Initialize();
            targetPage.SetSelectedQuestion(targetQuestion);
        }
예제 #2
0
        public PartPage(SectionPart part, Inspection inspection, SectionWithPartsPage sectionPage)
        {
            this.part       = part;
            this.inspection = inspection;
            Title           = "Part " + part.Label;
            Icon            = "TabIconGreenNoBG.png";
            List <QuestionPage> pages = InspectionHelper.GenerateQuestionPages(part.Questions, inspection, sectionPage);

            foreach (ContentPage page in pages)
            {
                Children.Add(page);
            }
            UpdateIcon(true);
            this.CurrentPageChanged += PartPage_CurrentPageChanged;
        }
예제 #3
0
        public PartPage(SectionPart part, Inspection inspection, SectionWithPartsPage sectionPage)
        {
            this.part       = part;
            this.inspection = inspection;
            parentPage      = sectionPage;
            Title           = "Part " + part.Label;
            List <QuestionPage> pages = InspectionHelper.GenerateQuestionPages(part.Questions, inspection, sectionPage);

            foreach (ContentPage page in pages)
            {
                Children.Add(page);
            }
            //InspectionHelper.InitializePages(pages);
            UpdateIcon();
            this.CurrentPageChanged += PartPage_CurrentPageChanged;
        }