Exemplo n.º 1
0
        public void ToSingleSelectionPage()
        {
            //ContentManager.singleSelectionPage.SetView();
            if (ContentManager.storageSelection == ContentManager.StorageSelection.cabinet)
            {
                // Populate page with new content to remove overlayed pages
                var cabinetPage = new SingleSelectionPage(LocalStorageController.DeleteCabinetSynchronous, FireBaseController.DeleteCabinetSynchronous, ContentManager.StorageSelection.cabinet);
                ReturnToBasePage(cabinetPage);

                currentPageContent = cabinetPage.GetLayout();
            }
            else
            {
                // Populate page with new content to remove overlayed pages
                var fridgePage = new SingleSelectionPage(LocalStorageController.DeleteCabinetSynchronous, FireBaseController.DeleteCabinetSynchronous, ContentManager.StorageSelection.fridge);
                ReturnToBasePage(fridgePage);

                currentPageContent = fridgePage.GetLayout();
            }
            navigationStack[currentPageContainer].Add(single_selection_name);
            navigationParams[currentPageContainer].Add(new List <object>()
            {
            });
        }
Exemplo n.º 2
0
        public void ToMainPage()
        {
            Children.Clear();

            cabinetSelectPage = new SingleSelectionPage(LocalStorageController.DeleteCabinetSynchronous, FireBaseController.DeleteCabinetSynchronous, ContentManager.StorageSelection.cabinet);
            fridgeSelectPage  = new SingleSelectionPage(LocalStorageController.DeleteFridgeSynchronous, FireBaseController.DeleteFridgeSynchronous, ContentManager.StorageSelection.fridge);
            unplacedPage      = new UnplacedPage(LocalStorageController.AddItem, FireBaseController.SaveItem, LocalStorageController.DeleteItem, FireBaseController.DeleteItem);

            // offset view from the top of IOS black box
            if (Device.RuntimePlatform == Device.iOS)
            {
                cabinetSelectPage.Content.AddEffect(new SafeAreaPadding());
            }
            cabinetSelectPage.Title = "Pantry";
            fridgeSelectPage.Title  = "Fridge";
            unplacedPage.Title      = "My Items";

            Children.Add(cabinetSelectPage);
            Children.Add(unplacedPage);
            Children.Add(fridgeSelectPage);
            navigationStack.Add(cabinetSelectPage, new List <string>());
            navigationStack.Add(fridgeSelectPage, new List <string>());
            navigationStack.Add(unplacedPage, new List <string>());
            navigationParams.Add(cabinetSelectPage, new List <List <object> >());
            navigationParams.Add(fridgeSelectPage, new List <List <object> >());
            navigationParams.Add(unplacedPage, new List <List <object> >());
            navigationStack[cabinetSelectPage].Add(single_selection_name);
            navigationParams[cabinetSelectPage].Add(new List <object>()
            {
            });
            navigationStack[fridgeSelectPage].Add(single_selection_name);
            navigationParams[fridgeSelectPage].Add(new List <object>()
            {
            });
            navigationStack[unplacedPage].Add(unplaced_page_name);
            navigationParams[unplacedPage].Add(new List <object>()
            {
            });

            currentPageContainer = (ContentPage)CurrentPage;
            currentPageContent   = ((IMainPage)CurrentPage).GetLayout();

            CurrentPageChanged += (o, a) =>
            {
                currentPageContainer = (ContentPage)CurrentPage;
                currentPageContent   = ((IMainPage)CurrentPage).GetLayout();
                RecordTabbedNavigationInfo();

                // offset view from the top of IOS black box
                if (Device.RuntimePlatform == Device.iOS)
                {
                    Console.WriteLine("PageController 157 inset set");
                    currentPageContent.AddEffect(new SafeAreaPadding());
                }

                // For Android only, resize and detect icon expiration
                resizeIconAction?.Invoke();
                Console.WriteLine("Pagecontroller 163 resize action is null " + (resizeIconAction == null));
            };
            OverwriteRootPage(this);
        }