async partial void ContentButtonClick(NSObject sender)
        {
            currentViewMode        = ContentMode.CM_Contents;
            ContentButton.State    = NSCellStateValue.On;
            IndexButton.State      = NSCellStateValue.Off;
            AnnotationButton.State = NSCellStateValue.Off;

            await HidePreNextButton(false);

            PageViewController.SetPageContentEmpty(true);
            PageViewController.SetIndexBannerLetter(null, false);
            BookContentView.Hidden = false;

            if (TOCDataManager.CurrentLeafNode != null)
            {
                PageViewController.AddLoadView();
                if (!this.IsInitialize)
                {
                    this.IsEnableAddNavigation = true;
                }
                await OpenPublicationContentAtTOCNode(BookID, TOCDataManager.CurrentLeafNode);
            }

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, true);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, false);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false);
        }
        partial void ContentButtonClick(NSObject sender)
        {
            ContentButton.State    = NSCellStateValue.On;
            IndexButton.State      = NSCellStateValue.Off;
            AnnotationButton.State = NSCellStateValue.Off;

            if (TOCDataManager == null)
            {
                TOCDataManager                   = new PublicationTOCDataManager(BookID, BookTitle, this);
                TOCViewController.BookID         = BookID;
                TOCViewController.IsExpired      = IsExpired;
                TOCViewController.CurrencyDate   = CurrencyDate;
                TOCViewController.TOCDataManager = TOCDataManager;
                TOCViewController.InitializeTableView();
            }

            PageViewController.SetIndexBannerLetter(null, false);

            if (TOCDataManager.CurrentLeafNode == null)
            {
                PageViewController.ShowPageContent(null, true);
            }
            else
            {
                OpenPublicationContentAtTOCNode(BookID, TOCDataManager.CurrentLeafNode);
            }

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, true);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, false);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false);
        }
        partial void AnnotationButtonClick(NSObject sender)
        {
            ContentButton.State    = NSCellStateValue.Off;
            IndexButton.State      = NSCellStateValue.Off;
            AnnotationButton.State = NSCellStateValue.On;

            PageViewController.SetIndexBannerLetter(null, false);
            PageViewController.ShowPageContent(null, false);

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, false);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, false);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, true);
        }
        private void SwitchToContentView()
        {
            currentViewMode        = ContentMode.CM_Contents;
            ContentButton.State    = NSCellStateValue.On;
            IndexButton.State      = NSCellStateValue.Off;
            AnnotationButton.State = NSCellStateValue.Off;

            HidePreNextButton(false);

            PageViewController.SetPageContentEmpty(true);
            PageViewController.SetIndexBannerLetter(null, false);
            BookContentView.Hidden = false;

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, true);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, false);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false);
        }
        public async void OpenPublicationIndexAtIndexNode(Index indexNode)
        {
            if (indexNode == null)
            {
                PageViewController.SetIndexBannerLetter(null, false);
                PageViewController.ShowPageContent(null, false);
            }
            else
            {
                if (!string.IsNullOrEmpty(indexNode.Title))
                {
                    PageViewController.SetIndexBannerLetter(indexNode.Title, true);
                }

                if (!string.IsNullOrEmpty(indexNode.FileName))
                {
                    string htmlString = await PublicationContentUtil.Instance.GetContentFromIndex(BookID, indexNode);

                    PageViewController.ShowPageContent(htmlString, true);
                }
            }
        }
        async partial void IndexButtonClick(NSObject sender)
        {
            ContentButton.State    = NSCellStateValue.Off;
            IndexButton.State      = NSCellStateValue.On;
            AnnotationButton.State = NSCellStateValue.Off;
            HidePreNextButton(true);

            if (IdxDataManager == null)
            {
                IdxDataManager                       = new IndexDataManager(BookID, BookTitle, this);
                IndexViewController.BookID           = BookID;
                IndexViewController.IndexDataManager = IdxDataManager;
                await IndexViewController.IndexDataManager.GetIndexDataFromDB();

                IndexViewController.InitializeOutlineView();
            }
            else
            {
                if (IdxDataManager.CurrentIndex != null)
                {
                    OpenPublicationIndexAtIndexNode(IdxDataManager.CurrentIndex);
                    PageViewController.SetIndexBannerLetter(null, true);
                }
            }

            PageViewController.View.Hidden = false;

            if (IdxDataManager.IndexNodeList == null)
            {
                PageViewController.SetIndexBannerLetter("No index files available.", true);
                PageViewController.ShowPageContent("No index files available.", true);
            }

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, false);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, true);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false);
        }
        async partial void IndexButtonClick(NSObject sender)
        {
            if (currentViewMode == ContentMode.CM_Index)
            {
                return;
            }

            currentViewMode        = ContentMode.CM_Index;
            ContentButton.State    = NSCellStateValue.Off;
            IndexButton.State      = NSCellStateValue.On;
            AnnotationButton.State = NSCellStateValue.Off;
            await HidePreNextButton(true);

            if (IdxDataManager.CurrentRow == 0)
            {
                IndexViewController.SelectItemByRow(1);
            }
            else
            {
                OpenPublicationIndexAtIndexNode(IdxDataManager.CurrentIndex);
            }

            BookContentView.Hidden = false;

            if (IdxDataManager.IndexNodeList == null)
            {
                PageViewController.SetIndexBannerLetter("No index files available.", true);
                string infoString = "<br>" + "<br>" + "<br>" + "<br>" + "No index files available.";
                PageViewController.ShowPageContent(infoString, true, 0, null, null);
            }

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, false);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, true);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false);
        }