Navigation lists

In this document
chevron_rightIn Xamarin.Android
chevron_rightIn Xamarin.iOS

linkIn Xamarin.Android

Using bookmarks dialog in Xamarin.Android is identical to using BookmarksDialogFragment in Android. See tutorial here.

For example, the equivalent of the example provided in the Android guide will be:

var bookmarksDialog = pdftron.PDF.Dialog.BookmarksDialogFragment.NewInstance();
bookmarksDialog.SetPdfViewCtrl(mPdfViewCtrl);
List<pdftron.PDF.Tools.Utils.DialogFragmentTab> tabs = new List<pdftron.PDF.Tools.Utils.DialogFragmentTab>();
var annotationsTab = new pdftron.PDF.Tools.Utils.DialogFragmentTab(
    Java.Lang.Class.FromType(typeof(AnnotationDialogFragment)), BookmarksTabLayout.TagTabAnnotation, null, "Annotations", "Bookmarks Dialog", null);
var outlineDialog = new pdftron.PDF.Tools.Utils.DialogFragmentTab(
    Java.Lang.Class.FromType(typeof(OutlineDialogFragment)), BookmarksTabLayout.TagTabOutline, null, "Outline", "Bookmarks Dialog", null);
var userBookmarksDialog = new pdftron.PDF.Tools.Utils.DialogFragmentTab(
    Java.Lang.Class.FromType(typeof(UserBookmarkDialogFragment)), BookmarksTabLayout.TagTabBookmark, null, "User Bookmarks", "Bookmarks Dialog", null);
tabs.Add(annotationsTab);
tabs.Add(outlineDialog);
tabs.Add(userBookmarksDialog);
bookmarksDialog.SetDialogFragmentTabs(tabs);
bookmarksDialog.SetStyle((int)DialogFragmentStyle.NoTitle, Resource.Style.CustomAppTheme);
bookmarksDialog.Show(this.SupportFragmentManager, "bookmarks_dialog");
bookmarksDialog.AnnotationClicked += (sender, e) =>
{
    bookmarksDialog.Dismiss();
};
bookmarksDialog.ExportAnnotations += (sender, e) =>
{
    // handle export annotations here
    bookmarksDialog.Dismiss();
};
bookmarksDialog.OutlineClicked += (sender, e) =>
{
    bookmarksDialog.Dismiss();
};
bookmarksDialog.UserBookmarkClick += (sender, e) =>
{
    mPdfViewCtrl.SetCurrentPage(e.PageNum);
    bookmarksDialog.Dismiss();
};

linkIn Xamarin.iOS

Using navigation lists in Xamarin.iOS is identical to using PTNavigationListsViewController in iOS. See tutorial here.

For example, the equivalent of the example provided in the iOS guide will be:

if (navigationListsViewController == null)
{
    navigationListsViewController = new PTNavigationListsViewController();
    navigationListsViewController.ListViewControllers = new UIViewController[] {
        getOutlineList(), getAnnotationsList(), getBookmarksList()
    };
}

this.PresentViewController(navigationListsViewController, true, null);

where

public AnnotationViewController getAnnotationsList()
{
    AnnotationViewController annotationViewController = new AnnotationViewController(mPdfViewCtrl);
    annotationViewController.AnnotationViewControllerAnnotaionSelected += (object sender, AnnotationViewControllerAnnotaionSelectedEventArgs e) => {
        // perform custom action
    };
    annotationViewController.AnnotationViewControllerDidCancel += (object sender, EventArgs e) => {
        // perform custom action
    };
    return annotationViewController;
}

public OutlineViewController getOutlineList()
{
    OutlineViewController outlineViewController = new OutlineViewController (mPdfViewCtrl);
    outlineViewController.OutlineViewControllerOutlineSelected += (sender, e) => {
        // perform custom action
    };
    outlineViewController.OutlineViewControllerDidCancel += (object sender, EventArgs e) => {
        // perform custom action
    };

    return outlineViewController;
}

public BookmarkViewController getBookmarksList()
{
    BookmarkViewController bookmarkViewController = new BookmarkViewController (mPdfViewCtrl);
    bookmarkViewController.BookmarkViewControllerBookmarkSelected += (sender, e) => {
        // perform custom action
    };
    bookmarkViewController.BookmarkViewControllerDidCancel += (object sender, EventArgs e) => {
        // perform custom action
    };

    return bookmarkViewController;
}