예제 #1
0
        public App()
        {
            InitializeComponent();

#if DEBUG
            Settings.UserIsLoggedIn = false;
#endif

            // As iOS and Android follow fundamenntally different navigation patterns, we split up the
            // navigation style between iOS and Android here. iOS is using a Tabbed Navigation,
            // while Android uses a Navigation Drawer (Hamburger Menu)
            if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS)
            {
                // Create tabbed navigation for iOS
                // Tab Bar Color is set in AppDelegate.cs within the iOS project
                var tabbedNavigation = new FreshTabbedFONavigationContainer("Contoso");
                tabbedNavigation.BarBackgroundColor = (Color)Current.Resources["BackgroundColorDark"];
                tabbedNavigation.BarTextColor       = (Color)Current.Resources["AccentColor"];

                // Add first level navigationpages as tabs
                tabbedNavigation.AddTab <JobsPageModel>("Jobs", "icon_jobs.png");
                tabbedNavigation.AddTab <PartsPageModel>("Parts", "icon_parts.png");
                tabbedNavigation.AddTab <ProfilePageModel>("Me", "icon_user.png");
                MainPage = tabbedNavigation;
            }
            else
            {
                var navContainer = new CustomAndroidNavigation("AndroidNavigation");
                navContainer.Init("Menu", "hamburger.png");
                navContainer.AddPage <JobsPageModel>("Jobs");
                navContainer.AddPage <PartsPageModel>("Parts");
                navContainer.AddPage <ProfilePageModel>("Me");
                MainPage = navContainer;
            }
        }
 public void LoadFOTabbedNav()
 {
     var tabbedNavigation = new FreshTabbedFONavigationContainer ();
     tabbedNavigation.AddTab<ContactListPageModel> ("Contacts", "contacts.png", null);
     tabbedNavigation.AddTab<QuoteListPageModel> ("Quotes", "document.png", null);
     MainPage = tabbedNavigation;
 }
예제 #3
0
        public App()
        {
            InitializeComponent();

            AlarmStorageService.InitSettings();
            GetAllAlarmTones();

            SetUpIoC();

            /*
             * TabbedPage page
             */
            var tabbedNavigation = new FreshTabbedFONavigationContainer("Alarm App");

            tabbedNavigation.BackgroundColor = (Color)Resources["PrimaryColor"];

            tabbedNavigation.AddTab <AlarmListPageModel>("Today's Alarms", null, AlarmListType.Today);
            tabbedNavigation.AddTab <AlarmListPageModel>("All Alarms", null, AlarmListType.All);
            MainPage = tabbedNavigation;

            /*
             * Single page
             */

            //var page = FreshPageModelResolver.ResolvePageModel<AlarmListPageModel>();
            //var nav = new FreshNavigationContainer(page);
            //nav.BackgroundColor = (Color)Resources["PrimaryColor"];
            //page.Title = "My Alarms";

            //MainPage = nav;


            //testing
            //MainPage = new TestPage();
        }
예제 #4
0
        public void LoadFOTabbedNav()
        {
            var tabbedNavigation = new FreshTabbedFONavigationContainer("CRM");

            tabbedNavigation.AddTab <ContactListPageModel>("Contacts", "contacts.png", null);
            tabbedNavigation.AddTab <QuoteListPageModel>("Quotes", "document.png", null);
            MainPage = tabbedNavigation;
        }
예제 #5
0
        protected void CreateMenuPages()
        {
            //var page = FreshPageModelResolver.ResolvePageModel<ArticlePageModel>();
            //page.Title = "Home";
            //_homePage = new FreshNavigationContainer(page, HomePageContainer);

            // HOME PAGE
            //_tabbedNavigationPage = new FreshTabbedFONavigationContainer(App.GetLanguageValue("Home", "首页"));
            //_tabbedNavigationPage.BackgroundColor = Color.FromHex("#e8eaed");
            //_tabbedNavigationPage.AddTab<DailyTextPageModel>(App.GetLanguageValue("Daily Text", "每日经文"), null);
            //_tabbedNavigationPage.AddTab<DictionaryPageModel>(App.GetLanguageValue("My Dictionary", "我的字典"), null);

            //var homePage = FreshPageModelResolver.ResolvePageModel<DailyTextPageModel>();
            //homePage.Title = "Home";
            //_homePage = new FreshNavigationContainer(homePage, HomePageContainer);

            // BIBLE
            var biblePage = FreshPageModelResolver.ResolvePageModel <BiblePageModel>();

            biblePage.Title = App.GetLanguageValue("Bible", "圣经");
            _biblePage      = new FreshNavigationContainer(biblePage, BiblePageContainer);

            // PUBLICATIONS
            var publicationsPage = FreshPageModelResolver.ResolvePageModel <PublicationsPageModel>();

            publicationsPage.Title = App.GetLanguageValue("Publications", "出版物");
            _publicationsPage      = new FreshNavigationContainer(publicationsPage, PublicationsPageContainer);

            // DICTIONARY
            var dictionaryPage = FreshPageModelResolver.ResolvePageModel <DictionaryPageModel>();

            dictionaryPage.Title = App.GetLanguageValue("Dictionary", "字典");
            _dictionaryPage      = new FreshNavigationContainer(dictionaryPage, DictionaryPageContainer);

            // SONGBOOK
            //var songBookPage = FreshPageModelResolver.ResolvePageModel<SongBookPageModel>();
            //songBookPage.Title = App.GetLanguageValue("“Sing Out Joyfully”", "高声欢唱");
            //_songBookPage = new FreshNavigationContainer(songBookPage, SongBookPageContainer);

            _tabbedNavigationPage = new FreshTabbedFONavigationContainer(App.GetLanguageValue("“Sing Out Joyfully”", "高声欢唱"));
            _tabbedNavigationPage.BackgroundColor = Color.FromHex("#e8eaed");
            _tabbedNavigationPage.AddTab <SongBookPageModel>(App.GetLanguageValue("NUMBER", "编号"), null);
            _tabbedNavigationPage.AddTab <PublicationContentsPageModel>(App.GetLanguageValue("TITLE", "歌名"), null, new PublicationGroup()
            {
                KeySymbol = "sjj", ShortTitle = ""
            });

            var page = FreshPageModelResolver.ResolvePageModel <TestPageModel>();

            page.Title    = "Meetings";
            _meetingsPage = new FreshNavigationContainer(page, AnotherPageContainer + "4");

            // SETTINGS
            var settingsPage = FreshPageModelResolver.ResolvePageModel <SettingsPageModel>();

            settingsPage.Title = App.GetLanguageValue("Settings", "设置");
            _settingsPage      = new FreshNavigationContainer(settingsPage, SettingsPageContainer + "5");
        }
예제 #6
0
      public void LoadFOTabbedNav()
      {
          var tabbedNavigation = new FreshTabbedFONavigationContainer("CRM");

          tabbedNavigation.AddTab <WeeklyEventsPageModel>("WEEK", null, null);
          tabbedNavigation.AddTab <CategoriesPageModel>("CATEGORIES", null, null);
          tabbedNavigation.AddTab <ProfilePageModel>("PROFILE", null, null);
          MainPage = tabbedNavigation;
      }
예제 #7
0
        // Handle Navigation to the MainTappedPage
        public void LoadMainTabbedPage()
        {
            //FreshMvvm supports TabbedNavigation with Navigation named Assessment
            var tabbedNavigation = new FreshTabbedFONavigationContainer("Assessment");

            //Add FirstPageModel with TabIcon1
            tabbedNavigation.AddTab <FirstPageModel>("First", "TabIcon1", null);
            //Add SecondPageModel with TabIcon2
            tabbedNavigation.AddTab <SecondPageModel>("Second", "TabIcon2", null);
            //Set tabbedNavigation as a MainPage
            MainPage = tabbedNavigation;
        }
예제 #8
0
        public App()
        {
            InitializeComponent();
            FlowListView.Init();


            // Configure Monkey Cache
            Barrel.ApplicationId = "ContosoFieldService";

#if DEBUG
            Settings.LoginViewShown = false;
#endif


            // Stop the keyboard overlaying the chatbot webview on Android (it isn't a problem on iOS).
            Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);

            // As iOS and Android follow fundamenntally different navigation patterns, we split up the
            // navigation style between iOS and Android here. iOS is using a Tabbed Navigation,
            // while Android uses a Navigation Drawer (Hamburger Menu)
            if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS)
            {
                // Create tabbed navigation for iOS
                // Tab Bar Color is set in AppDelegate.cs within the iOS project
                var tabbedNavigation = new FreshTabbedFONavigationContainer("Contoso");
                tabbedNavigation.BarBackgroundColor = (Color)Current.Resources["BackgroundColorDark"];
                tabbedNavigation.BarTextColor       = (Color)Current.Resources["AccentColor"];

                // Add first level navigationpages as tabs
                tabbedNavigation.AddTab <JobsViewModel>("Jobs", "icon_jobs.png");
                tabbedNavigation.AddTab <PartsViewModel>("Parts", "icon_parts.png");
                tabbedNavigation.AddTab <ProfileViewModel>("Me", "icon_user.png");
                MainPage = tabbedNavigation;
            }
            else
            {
                var navContainer = new CustomAndroidNavigation("AndroidNavigation");
                navContainer.Init("Menu", "hamburger.png");
                navContainer.AddPage <JobsViewModel>("Jobs");
                navContainer.AddPage <PartsViewModel>("Parts");
                navContainer.AddPage <ProfileViewModel>("Me");
                navContainer.AddPage <BotViewModel>("Bot");
                navContainer.AddPage <SettingsViewModel>("Settings");
                MainPage = navContainer;
            }
        }
예제 #9
0
        public void SwitchNavigation(NavigationStacks navigationStacks, FreshBasePageModel page)
        {
            switch (navigationStacks)
            {
            case (NavigationStacks.Authentication):
                var loginPage = FreshPageModelResolver.ResolvePageModel <LoginViewModel>();
                var authenticationNavContainer = new FreshNavigationContainer(loginPage, navigationStacks.ToString());
                page.CoreMethods.SwitchOutRootNavigation(navigationStacks.ToString());
                break;

            case (NavigationStacks.Main):
                var mainPage         = FreshPageModelResolver.ResolvePageModel <MainViewModel>();
                var mainNavContainer = new FreshNavigationContainer(mainPage, navigationStacks.ToString());
                page.CoreMethods.SwitchOutRootNavigation(navigationStacks.ToString());
                break;

            case (NavigationStacks.MasterDetail):
                var mainMasterDetailContainer = new FreshMasterDetailNavigationContainer(navigationStacks.ToString());
                mainMasterDetailContainer.AddPage <MainViewModel>("Contacts");
                mainMasterDetailContainer.AddPage <AboutViewModel>("About");
                mainMasterDetailContainer.AddPage <LogoutViewModel>("Logout");
                mainMasterDetailContainer.Init("Menu");
                page.CoreMethods.SwitchOutRootNavigation(navigationStacks.ToString());
                break;

            case (NavigationStacks.Tabbed):
                var tabbedContainer = new FreshTabbedNavigationContainer(navigationStacks.ToString());
                tabbedContainer.AddTab <MainViewModel>("Contacts", null);
                tabbedContainer.AddTab <AboutViewModel>("About", null);
                page.CoreMethods.SwitchOutRootNavigation(navigationStacks.ToString());
                break;

            case (NavigationStacks.TabbedFO):
                var tabbedFOContainer = new FreshTabbedFONavigationContainer(navigationStacks.ToString());
                tabbedFOContainer.AddTab <MainViewModel>("Contacts", null);
                tabbedFOContainer.AddTab <AboutViewModel>("About", null);
                page.CoreMethods.SwitchOutRootNavigation(navigationStacks.ToString());
                break;
            }
        }