예제 #1
0
 private void openReferencePage(object sender, EventArgs e)
 {
     Device.BeginInvokeOnMainThread(async() =>
     {
         string referenceName = inspection.ChecklistId + "/" + question.References.First().DocumentName;
         string bookmark      = question.References.First().Bookmark;
         int pageNumber       = 1;
         if (bookmark != string.Empty)
         {
             pageNumber = int.Parse(bookmark);
         }
         ReferencePage page = new ReferencePage(referenceName, pageNumber);
         await App.Navigation.PushAsync(page);
     });
 }
예제 #2
0
 void openReferencePage(object sender, EventArgs e)
 {
     Device.BeginInvokeOnMainThread(async() =>
     {
         string referenceName = folderName + "/" + reference.DocumentName;
         string bookmark      = reference.Bookmark;
         int pageNumber       = 1;
         if (bookmark != string.Empty)
         {
             pageNumber = int.Parse(bookmark);
         }
         ReferencePage page = new ReferencePage(referenceName, pageNumber);
         await App.Navigation.PushAsync(page);
     });
 }
예제 #3
0
        public ReferenceListPage(ChecklistModel checklist)
        {
            this.checklist = checklist;
            Title          = "Reference List";

            TableView    view    = new TableView();
            TableRoot    root    = new TableRoot();
            TableSection section = new TableSection();

            List <Reference> references = new List <Reference>();

            foreach (List <Reference> questionReferences in checklist.GetAllQuestions().Select(q => q.References))
            {
                references.AddRange(questionReferences);
            }
            //folderName + "/" + reference.DocumentName;
            IEnumerable <string> fileNames = references.Select(r => r.DocumentName).Distinct();

            foreach (string fileName in fileNames)
            {
                ViewCell    cell   = new ViewCell();
                StackLayout layout = new StackLayout();
                layout.Padding = new Thickness(10, 0, 0, 0);

                Button button = new Button();
                button.Text = removeFileExtension(fileName);
                button.HorizontalOptions = LayoutOptions.StartAndExpand;
                button.Clicked          += async(object Sender, EventArgs e) =>
                {
                    string        folderName   = checklist.Id;
                    string        relativePath = folderName + "/" + fileName;
                    ReferencePage page         = new ReferencePage(relativePath, 1);
                    await App.Navigation.PushAsync(page);
                };

                layout.Children.Add(button);
                cell.View = layout;
                section.Add(cell);
            }

            root.Add(section);
            view.Root = root;
            Content   = view;
        }