public BookSearchDisplayDelegate(PopoverSearchController parent)
            {
                this.parent = parent;

                myBooks        = BooksOnDeviceAccessor.GetBooks();
                availableBooks = BooksOnServerAccessor.GetBooks();
            }
Example #2
0
        void HandleSearchButtonTouchUpInside(object sender, EventArgs args)
        {
            HidePopovers();

            // psc
            if (psc == null)
            {
                psc = new PopoverSearchController(searchString);
                psc.RowSelectedEvent   += HandleSearchResultSelectedEvent;
                psc.ResizePopoverEvent += (nfloat height) =>
                {
                    // Do not cover the TabBar
                    nfloat viewHeight = this.View.Frame.Height - 55;
                    if (height > viewHeight)
                    {
                        height = viewHeight - 20;
                    }

                    psc.PreferredContentSize = new CGSize(psc.View.Frame.Width, height);
                };
            }

            // searchViewController
            searchViewController             = new UIPopoverController(psc);
            searchViewController.DidDismiss += delegate
            {
                searchString = psc.SearchDisplayController.SearchBar.Text;

                searchViewController.Dispose();
                searchViewController = null;
            };
            searchViewController.SetPopoverContentSize(new CGSize(psc.View.Frame.Width, psc.View.Frame.Height), true);
            searchViewController.PresentFromBarButtonItem(searchButton, UIPopoverArrowDirection.Any, true);
        }
            public PopoverSearchDataSource(PopoverSearchController parent, List <Book> myBooks, List <Book> availableBooks)
            {
                this.parent         = parent;
                this.myBooks        = myBooks;
                this.availableBooks = availableBooks;

                dictionary = new Dictionary <NSIndexPath, PopoverSearchResultView>();
            }