Example #1
1
		void SetupTabbedPage()
		{
			_tabbedNavigationPage = new FreshTabbedNavigationContainer ();
			_contactsPage = _tabbedNavigationPage.AddTab<ContactListPageModel> ("Contacts", "contacts.png");
			_quotesPage = _tabbedNavigationPage.AddTab<QuoteListPageModel> ("Quotes", "document.png");
			this.Detail = _tabbedNavigationPage;
		}
Example #2
0
        public App()
        {
            InitializeComponent();

            if (Device.RuntimePlatform == Device.iOS)
            {
                var tabs = new FreshTabbedNavigationContainer("RunkeeperTabs");

                tabs.AddTab <MePageModel>("Me", "me.png");
                tabs.AddTab <MyPlanPageModel>("My Plan", "myplan.png");
                tabs.AddTab <StartPageModel>("Start", "start.png");
                tabs.AddTab <FriendsPageModel>("Friends", "friends.png");
                tabs.AddTab <ChallengesPageModel>("Challenges", "challenges.png");

                // Set the selected tab to the middle one.
                tabs.SwitchSelectedRootPageModel <StartPageModel>();

                MainPage = tabs;
            }
            else
            {
                var navContainer = new CustomNavigation();

                navContainer.Init("Menu", "hamburger.png");
                navContainer.AddPage <StartPageModel>("Start");
                navContainer.AddPage <MePageModel>("Me");
                navContainer.AddPage <MeClonePageModel>("MeClone");

                MainPage = navContainer;
            }
        }
        public static void RemoveTab <T>(this FreshTabbedNavigationContainer container)
        {
            (container.TabbedPages as List <Page>).RemoveAll(p => p is T);

            NavigationPage pageToRemove = null;

            foreach (var child in container.Children)
            {
                if (!(child is NavigationPage navigationPage))
                {
                    continue;
                }

                if (navigationPage.RootPage is T)
                {
                    pageToRemove = navigationPage;
                    break;
                }
            }

            if (pageToRemove != null)
            {
                container.Children.Remove(pageToRemove);
            }
        }
Example #4
0
 void SetupTabbedPage()
 {
     _tabbedNavigationPage = new FreshTabbedNavigationContainer();
     _contactsPage         = _tabbedNavigationPage.AddTab <ContactListPageModel> ("Contacts", "contacts.png");
     _quotesPage           = _tabbedNavigationPage.AddTab <QuoteListPageModel> ("Quotes", "document.png");
     this.Detail           = _tabbedNavigationPage;
 }
Example #5
0
        Page LoadMain()
        {
            // init main page using resolver
            var mainMenuPage = FreshPageModelResolver.ResolvePageModel <MainMenuPageModel> ();

            mainMenuPage.Title = "Menu";

            var masterPageArea = new FreshNavigationContainer(mainMenuPage, MainAppMenuContainerName);

            masterPageArea.Title = "Menu";
            masterPageArea.Icon  = "menu.png";

            // this is for the tab bar on the bottom
            var detailPageArea = new FreshTabbedNavigationContainer(MainAppDetailContainerName)
            {
                Title = "Home"
            };

            // data allows us to send an object to the Init() of the pageModel. not needed here, but useful.
            detailPageArea.AddTab <HomePageModel> (title: "Contacts", icon: "contacts.png", data: null);
            detailPageArea.AddTab <QuoteListPageModel> (title: "Quotes", icon: "document.png", data: null);
            detailPageArea.AddTab <ArticleListPageModel>(title: "Articles", icon: "document.png", data: null);
            // this is so we can have the hamburger menu
            var masterDetailPageArea = new FreshMasterDetailNavigationContainer(MainAppMasterDetailContainerName);

            masterDetailPageArea.Master = masterPageArea;
            masterDetailPageArea.Detail = detailPageArea;

            App.mainMasterDetail = masterDetailPageArea;

            return(masterDetailPageArea);
        }
Example #6
0
 public async Task LoadTabbedNav ()
 {
     var tabbedNavigation = new FreshTabbedNavigationContainer ();
     await tabbedNavigation.AddTab<ContactListPageModel> ("Contacts", "contacts.png", null);
     await tabbedNavigation.AddTab<QuoteListPageModel> ("Quotes", "document.png", null);
     MainPage = tabbedNavigation;
 }
Example #7
0
        public App()
        {
            InitializeComponent();

            RegisterServices();

            _tabbedPage = new FreshTabbedNavigationContainer();

            if (Device.OS == TargetPlatform.iOS)
            {
                _tabbedPage.AddTab <FavoriteMoviesPageModel>("Favorite", "starFilled");
                _tabbedPage.AddTab <SearchPageModel>("Search", "searchIcon");
            }
            else
            {
                _tabbedPage.AddTab <FavoriteMoviesPageModel>("Favorite", null);
                _tabbedPage.AddTab <SearchPageModel>("Search", null);
            }

            var store = FreshIOC.Container.Resolve <IAppStoreContainer>().Store;

            store.Dispatch(FreshIOC.Container.Resolve <DataActionCreator>().LoadGenresAction);

            TryAddProfilePage(store);

            MainPage = _tabbedPage;
        }
Example #8
0
        public App()
        {
            try
            {
                Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MTU5MTk4QDMxMzcyZTMzMmUzMGFvd0UvK2ZtUm5LSXYxRE9Rc3NvZnBOUFZqTHJqWkF2WVFKa1JVRENETFk9");
                InitializeComponent();

                // Page page = new BankyApp.MainPage();
                //page.BindingContext = new MainPageModel();
                //  var mainPage = new FreshNavigationContainer(page);

                var mainPage = new FreshTabbedNavigationContainer();


                // mainPage.On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
                //mainPage.UnselectedTabColor = Color.Black;
                //mainPage.SelectedTabColor = Color.DodgerBlue;
                mainPage.AddTab <TrackerPageModel>("Tracker", null);
                mainPage.AddTab <AccountsPageModel>("Accounts", null);
                mainPage.AddTab <AboutPageModel>("About", null);
                mainPage.AddTab <ContactPageModel>("Contact", null);


                MainPage = mainPage;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #9
0
        /// <summary>
        /// Setup the pages
        /// </summary>
        /// <param name="tabpage">Tabpage.</param>
        public static void SetupPages(int tabpage)
        {
            var tabbedNavigation = new FreshTabbedNavigationContainer();

            //// Tabbed Based
            //// =============
            //tabbedNavigation.AddTab<StartPageModel>("Home", "tab_home3.png");
            //tabbedNavigation.AddTab<SettingsPageModel>("Settings", "tab_settings.png");
            //Application.Current.MainPage = tabbedNavigation;
            //tabbedNavigation.SelectedItem = tabbedNavigation.Children[tabpage];

            //// Master Detail Based
            //// ===================
            //var masterDetailNav = new FreshMasterDetailNavigationContainer();
            //masterDetailNav.Init("Menu");
            //masterDetailNav.AddPage<StartPageModel>("Start", null);
            //masterDetailNav.AddPage<SettingsPageModel>("Settings", null);
            //Application.Current.MainPage = masterDetailNav;

            // Master Detail Based on new AppStandardFreshMasterDetailNavigationContainer
            // ===================
            var masterDetailNav = new AppStandardFreshMasterDetailNavigationContainer();

            masterDetailNav.Init("Menu");
            masterDetailNav.AddPage <StartPageModel>(new AppStandardNavMenuItem("Start", "tab_home3.png"), null);
            masterDetailNav.AddPage <SettingsPageModel>(new AppStandardNavMenuItem("Settings", "tab_settings.png"), null);
            Application.Current.MainPage = masterDetailNav;
        }
Example #10
0
 private void SetupTabbedPage()
 {
     _tabbedNavigations = new FreshTabbedNavigationContainer();
     _searchPage        = _tabbedNavigations.AddTab <SearchShopsPageModel>("Search", "");
     //      _shopServiceHistoryPage = _tabbedNavigations.AddTab<ServiceShopHistoryPageModel>("Previous Shops", "");
     this.Detail = _tabbedNavigations;
 }
Example #11
0
        public App()
        {
            FreshIOC.Container.Register <IActivityService, ActivityService> ();
            var tabbedNavigation = new FreshTabbedNavigationContainer();

            tabbedNavigation.AddTab <ActivityListPageModel> ("Activities", null);
            MainPage = tabbedNavigation;
        }
Example #12
0
        public void LoadTabbedNav()
        {
            var tabbedNavigation = new FreshTabbedNavigationContainer();

            tabbedNavigation.AddTab <ContactListPageModel>("Contacts", "contacts.png", null);
            tabbedNavigation.AddTab <QuoteListPageModel>("Quotes", "document.png", null);
            MainPage = tabbedNavigation;
        }
Example #13
0
        private void SetupTabbedNav()
        {
            var tabbedNav = new FreshTabbedNavigationContainer();

            tabbedNav.AddTab <ContactListPageModel>(PageNames.Contacts, null);
            tabbedNav.AddTab <QuoteListPageModel>(PageNames.Quotes, null);
            this.MainPage = tabbedNav;
        }
Example #14
0
        private FreshBasePageModel GetCurrentPageModel()
        {
            FreshTabbedNavigationContainer freshTabbedNavigationContainer = Current.MainPage as FreshTabbedNavigationContainer;
            NavigationPage     navigationPage = freshTabbedNavigationContainer.CurrentPage as NavigationPage;
            Page               page           = navigationPage.RootPage as Page;
            FreshBasePageModel pageModel      = page.BindingContext as FreshBasePageModel;

            return(pageModel);
        }
Example #15
0
        public App()
        {
            InitializeComponent();
            var mainPage = new FreshTabbedNavigationContainer();

            mainPage.AddTab <FirstPageModel>("First", null);
            mainPage.AddTab <SecondPageModel>("Second", null);
            MainPage = mainPage;
        }
Example #16
0
        private void SetupNavigation()
        {
            var tabbedNavigation = new FreshTabbedNavigationContainer();

            tabbedNavigation.AddTab <HomePageModel>("Home", null);
            tabbedNavigation.AddTab <BetListPageModel>("Bets", null);

            MainPage = tabbedNavigation;
        }
Example #17
0
        public App()
        {
            var tabbedNav = new FreshTabbedNavigationContainer();

            tabbedNav.AddTab <DisplayPageModel> ("All Vegetables", null);
            tabbedNav.AddTab <FavoritesPageModel> ("Fave Vegetables", null);
            tabbedNav.AddTab <NewVegetablePageModel> ("Add Vegetable", null);
            MainPage = tabbedNav;
        }
Example #18
0
        public App()
        {
            // The root page of your application
            var mainPage = new FreshTabbedNavigationContainer();

            mainPage.AddTab<TabOnePageModel>("Hello", null);
            mainPage.AddTab<TabTwoPageModel>("unicorn!", null);
            MainPage = mainPage;
        }
Example #19
0
        void SetupTabbedPage()
        {
            _tabbedNavigationPage = new FreshTabbedNavigationContainer();

            _HomePage     = _tabbedNavigationPage.AddTab <HomePageModel>("Home", null);
            _rankingPage  = _tabbedNavigationPage.AddTab <RankingPageModel>("Ranking!", null);
            _settingsPage = _tabbedNavigationPage.AddTab <SettingsPageModel>("Settings", null);
            this.Detail   = _tabbedNavigationPage;
        }
Example #20
0
        public void SwitchToMainPage()
        {
            var tabbed = new FreshTabbedNavigationContainer();

            tabbed.AddTab <MainPageModel>("Been pwned?", "icon-pwned.png");
            tabbed.AddTab <BreachesPageModel>("Breaches", "icon-breaches.png");
            tabbed.AddTab <PasswordPageModel>("Passwords", "icon-password.png");

            MainPage = tabbed;
        }
        public static FreshTabbedNavigationContainer CreateNavigation()
        {
            var tabbedNavigations = new FreshTabbedNavigationContainer();

            tabbedNavigations.AddTab <SearchShopsPageModel>("Search", "Search-30.png");
            tabbedNavigations.AddTab <ServiceShopHistoryPageModel>("Previous Shops", "");
            tabbedNavigations.AddTab <ProfilePageModel>("Profile", "Gender-Neutral-User-30");

            return(tabbedNavigations);
        }
Example #22
0
        /*
         * public void FreshTabbedNavigationContainer(string navigationServiceName)
         * {
         *  NavigationServiceName = navigationServiceName;
         *  RegisterNavigation();
         * }
         *
         * protected void RegisterNavigation()
         * {
         *  FreshIOC.Container.Register<IFreshNavigationService>(this, NavigationServiceName);
         * }
         *
         */
        void SetupTabbedNav()
        {
            tabbedContainer = new FreshTabbedNavigationContainer();
            tabbedContainer.AddTab <NowPageModel>("Now", null);
            tabbedContainer.AddTab <DayPageModel>("Today", null);
            tabbedContainer.AddTab <WeekPageModel>("Week", null);

            //         tabbedContainer.BarBackgroundColor=Color.Black;
            //         tabbedContainer.BarTextColor = Color.White;
        }
Example #23
0
        private void loadTabbedPage()
        {
            var tabbedNavigation = new FreshTabbedNavigationContainer();

            tabbedNavigation.On <Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
            tabbedNavigation.BackgroundColor = Color.FromHex("#F9F9F9");
            tabbedNavigation.AddTab <MainHomePageModel>("", "callblue.png");
            tabbedNavigation.AddTab <HistoryListPageModel>("", "history.png");
            App.Current.MainPage = tabbedNavigation;
        }
Example #24
0
        public void Navigation()
        {
            var tabbedNavigation = new FreshTabbedNavigationContainer();

            tabbedNavigation.AddTab <HomePageModel>("Home", "Home1.png");
            tabbedNavigation.AddTab <TeamPageModel>("Team", "Team1.png");
            tabbedNavigation.AddTab <ContactPageModel>("Contacts", "Contact1.png");
            tabbedNavigation.AddTab <ResourcesPageModel>("Resources", "Other1.png");

            MainPage = tabbedNavigation;
        }
Example #25
0
        private void InitializePages()
        {
            var tabbedNavigation = new FreshTabbedNavigationContainer();

            tabbedNavigation.AutomationId = "MainTab";
            tabbedNavigation.AddTab <HomeViewModel>("Home", "Home.png", null);
            //tabbedNavigation.AddTab<NotificationViewModel>("Notification", "Notification.png", null);
            tabbedNavigation.AddTab <AccountViewModel>("Account", "Account.png", null);

            MainPage = tabbedNavigation;
        }
Example #26
0
        public App()
        {
            InitializeComponent();

            var tabbedNavigation = new FreshTabbedNavigationContainer();

            tabbedNavigation.AddTab <GamesPageModel>("Games", Images.CourtsTab);
            tabbedNavigation.AddTab <FriendsPageModel>("Friends", Images.FriendsTab);
            tabbedNavigation.AddTab <ProfilePageModel>("Profile", Images.ProfileTab);
            MainPage = tabbedNavigation;
        }
Example #27
0
        public void SwitchNavigation()
        {
            var tabbedNavigation = new FreshTabbedNavigationContainer("secondNavPage");

            tabbedNavigation.AddTab <HomePageModel>("Home", "Home1.png", null);
            tabbedNavigation.AddTab <TeamPageModel>("Team", "Team1.png", null);
            tabbedNavigation.AddTab <EventsPageModel>("Events", "Contact1.png", null);
            tabbedNavigation.AddTab <ResourcesPageModel>("Resources", "Other1.png", null);

            CoreMethods.SwitchOutRootNavigation("secondNavPage");
        }
Example #28
0
        public App()
        {
            InitializeComponent();

            var tabbedNavigation = new FreshTabbedNavigationContainer(NavContainerName);

            tabbedNavigation.AddTab <CategoriesPageModel> ("Categories", null);
            MainPage = tabbedNavigation;

            //MainPage = new MainPage();
        }
Example #29
0
        public App()
        {
            InitializeComponent();

            var tabbedPage = new FreshTabbedNavigationContainer();

            // Sorry about the horrible looking icon sizes...
            tabbedPage.AddTab <DncMvvmPageModel>("Home", "icon.png");
            tabbedPage.AddTab <AnotherPageModel>("Another", "anothericon.png");

            MainPage = tabbedPage;
        }
Example #30
0
        public App()
        {
            InitializeComponent();

            var container = new FreshTabbedNavigationContainer();

            container.AddTab <CurrentTradePageModel>("Trades", "trades.png");
            container.AddTab <HistoryPageModel>("History", "history.png");
            container.AddTab <SettingsPageModel>("Settings", "settings.png");

            MainPage = container;
        }
        public void pagemodel_should_be_link_to_when_created_firsttime()
        {
            //master detail navigation
            var masterDetailNavigation = new FreshMasterDetailNavigationContainer("TestingLinking");

            masterDetailNavigation.AddPage <MockContentPageModel> ("Page1", null);
            masterDetailNavigation.AddPage <MockContentPageModel> ("Page2", null);
            var pageModel1 = masterDetailNavigation.Pages ["Page1"].GetPageFromNav().GetModel();
            var pageModel2 = masterDetailNavigation.Pages ["Page2"].GetPageFromNav().GetModel();

            pageModel1.CurrentNavigationServiceName.Should().Be("TestingLinking");
            pageModel2.CurrentNavigationServiceName.Should().Be("TestingLinking");

            if (FreshIOC.Container.Resolve <IFreshNavigationService> ("TestingLinking") == null)
            {
                throw new Exception("Should contain navigation service");
            }

            //tabbed navigation
            var tabbedNavigation = new FreshTabbedNavigationContainer("TestingLinking2");

            tabbedNavigation.AddTab <MockContentPageModel> ("Page1", null);
            tabbedNavigation.AddTab <MockContentPageModel> ("Page2", null);
            var tabbedPageModel1 = tabbedNavigation.TabbedPages.First().GetModel();
            var tabbedPageModel2 = tabbedNavigation.TabbedPages.Skip(1).Take(1).First().GetModel();

            tabbedPageModel1.CurrentNavigationServiceName.Should().Be("TestingLinking2");
            tabbedPageModel2.CurrentNavigationServiceName.Should().Be("TestingLinking2");

            if (FreshIOC.Container.Resolve <IFreshNavigationService> ("TestingLinking2") == null)
            {
                throw new Exception("Should contain navigation service");
            }

            //standard navigation should set named navigation
            var page      = FreshPageModelResolver.ResolvePageModel <MockContentPageModel>();
            var pageModel = page.BindingContext as MockContentPageModel;

            new FreshNavigationContainer(page, "testingLinking3");
            pageModel.CurrentNavigationServiceName.Should().Be("testingLinking3");

            if (FreshIOC.Container.Resolve <IFreshNavigationService> ("testingLinking3") == null)
            {
                throw new Exception("Should contain navigation service");
            }

            //standard navigation should throw exception when binding context isn't a FreshBasePageModel
            var    pageEx = new Page();
            Action standardNavExeption = () => new FreshNavigationContainer(pageEx, "testingLinking");

            standardNavExeption.ShouldThrow <Exception> ().WithMessage("BindingContext was not a FreshBasePageModel on this Page");
        }
Example #32
0
        public App()
        {
            FreshIOC.Container.Register<IActivityService, ActivityService> ();

            //var page = FreshPageModelResolver.ResolvePageModel<ActivityListPageModel> ();
            //var basicNavContainer = new FreshNavigationContainer (page);
            //MainPage = basicNavContainer;

            var tabbedNavigation = new FreshTabbedNavigationContainer ();
            tabbedNavigation.AddTab<ActivityListPageModel> ("Activities", null);
            MainPage = tabbedNavigation;

            //			MainPage = new NavigationPage(page);
        }
Example #33
0
        public App()
        {
            InitializeComponent();

            FreshIOC.Container.Register <IDataService, SqlDataService>();
            FreshIOC.Container.Register <IRemoteService, RemoteService>();

            var tabs = new FreshTabbedNavigationContainer();

            tabs.AddTab <TareasViewModel>("Tareas", "tarea");
            tabs.AddTab <ClientesViewModel>("Clientes", "cliente");

            MainPage = tabs;
        }
 public void SwitchOnIdiom()
 {
     if (Device.Idiom == TargetIdiom.Phone) {
         var masterDetailNav = new FreshMasterDetailNavigationContainer ();
         masterDetailNav.Init ("Menu");
         masterDetailNav.AddPage<ContactListPageModel> ("Contacts", null);
         masterDetailNav.AddPage<QuoteListPageModel> ("Quotes", null);
         MainPage = masterDetailNav;
     } else {
         var tabbedNavigation = new FreshTabbedNavigationContainer ();
         tabbedNavigation.AddTab<ContactListPageModel> ("Contacts", "contacts.png", null);
         tabbedNavigation.AddTab<QuoteListPageModel> ("Quotes", "document.png", null);
         MainPage = tabbedNavigation;
     }
 }
Example #35
0
        private void HandleIOSSetup()
        {
            var tabs = new FreshTabbedNavigationContainer("RunkeeperTabs");

            tabs.AddTab <Page1ViewModel>("Page 1", "icon.png");
            tabs.AddTab <Page2ViewModel>("Page 2", "icon.png");
            tabs.AddTab <Page3ViewModel>("Page 3", "icon.png");
            tabs.AddTab <Page4ViewModel>("Page 4", "icon.png");
            tabs.AddTab <Page5ViewModel>("Page 5", "icon.png");

            // Set the selected tab to the middle one.
            tabs.SwitchSelectedRootPageModel <Page3ViewModel>();

            MainPage = tabs;
        }
        public void pagemodel_should_be_link_to_when_created_firsttime()
        {
            //master detail navigation
            var masterDetailNavigation = new FreshMasterDetailNavigationContainer("TestingLinking");
            masterDetailNavigation.AddPage<MockContentPageModel> ("Page1", null);
            masterDetailNavigation.AddPage<MockContentPageModel> ("Page2", null);
            var pageModel1 = masterDetailNavigation.Pages ["Page1"].GetPageFromNav().GetModel ();
            var pageModel2 = masterDetailNavigation.Pages ["Page2"].GetPageFromNav().GetModel();
            pageModel1.CurrentNavigationServiceName.Should ().Be ("TestingLinking");
            pageModel2.CurrentNavigationServiceName.Should ().Be ("TestingLinking");

            if (FreshIOC.Container.Resolve<IFreshNavigationService> ("TestingLinking") == null)
                throw new Exception ("Should contain navigation service");

            //tabbed navigation 
            var tabbedNavigation = new FreshTabbedNavigationContainer("TestingLinking2");
            tabbedNavigation.AddTab<MockContentPageModel> ("Page1", null);
            tabbedNavigation.AddTab<MockContentPageModel> ("Page2", null);
            var tabbedPageModel1 = tabbedNavigation.TabbedPages.First ().GetModel ();
            var tabbedPageModel2 = tabbedNavigation.TabbedPages.Skip (1).Take (1).First ().GetModel ();
            tabbedPageModel1.CurrentNavigationServiceName.Should ().Be ("TestingLinking2");
            tabbedPageModel2.CurrentNavigationServiceName.Should ().Be ("TestingLinking2");

            if (FreshIOC.Container.Resolve<IFreshNavigationService> ("TestingLinking2") == null)
                throw new Exception ("Should contain navigation service");
            
            //standard navigation should set named navigation
            var page = FreshPageModelResolver.ResolvePageModel<MockContentPageModel>();
            var pageModel = page.BindingContext as MockContentPageModel;
            var standardNavigation = new FreshNavigationContainer(page, "testingLinking3");
            pageModel.CurrentNavigationServiceName.Should ().Be ("testingLinking3");

            if (FreshIOC.Container.Resolve<IFreshNavigationService> ("testingLinking3") == null)
                throw new Exception ("Should contain navigation service");
            
            //standard navigation should throw exception when binding context isn't a FreshBasePageModel
            var pageEx = new Page();
            Action standardNavExeption = () => new FreshNavigationContainer(pageEx, "testingLinking");
            standardNavExeption.ShouldThrow<Exception> ().WithMessage ("BindingContext was not a FreshBasePageModel on this Page");
        }