Exemplo n.º 1
0
        /// <summary>
        /// The run app launch.
        /// </summary>
        public override void RunAppLaunch()
        {
            Page pageToShow       = FreshPageModelResolver.ResolvePageModel <MainViewModel>();
            var  mainNavContainer = new FreshNavigationContainer(pageToShow, NavigationContainerNames.MainContainer);

            Application.Current.MainPage = mainNavContainer;
        }
Exemplo n.º 2
0
        public void AbrirMainMenu(Familiar familiar)
        {
            var page     = FreshPageModelResolver.ResolvePageModel <MainMenuPageModel>(familiar);
            var mainPage = new FreshNavigationContainer(page);

            MainPage = mainPage;
        }
Exemplo n.º 3
0
        private void InitMainPage()
        {
            var page = FreshPageModelResolver.ResolvePageModel <TodoListPageModel>();
            var basicNavContainer = new FreshNavigationContainer(page);

            MainPage = basicNavContainer;
        }
Exemplo n.º 4
0
        public App()
        {
            var contactList  = FreshPageModelResolver.ResolvePageModel <ContactListPageModel>(null);
            var navContainer = new FreshNavigationContainer(contactList);

            MainPage = navContainer;
        }
Exemplo n.º 5
0
        public App()
        {
            var page = FreshPageModelResolver.ResolvePageModel <UserListPageModel>();
            var navigationContainer = new FreshNavigationContainer(page);

            MainPage = navigationContainer;
        }
Exemplo n.º 6
0
        private void InitializeNavigation()
        {
            var mainPage  = FreshPageModelResolver.ResolvePageModel <MainViewModel>();
            var mainStack = new FreshNavigationContainer(mainPage, "mainStack");

            MainPage = mainStack;
        }
        protected void SwitchToMainNavigation()
        {
            var dashboard     = FreshPageModelResolver.ResolvePageModel <ProjectListPageModel>();
            var mainContainer = new FreshNavigationContainer(dashboard, NavigationContainerNames.MainContainer);

            CoreMethods.SwitchOutRootNavigation(NavigationContainerNames.MainContainer);
        }
Exemplo n.º 8
0
        void SetupMain()
        {
            var firstPage    = FreshPageModelResolver.ResolvePageModel <CognitivePOC_PCLPageModel>();
            var navContainer = new FreshNavigationContainer(firstPage);

            MainPage = navContainer;
        }
Exemplo n.º 9
0
        public void AbrirMainMenu(Cuidador cuidador)
        {
            var page     = FreshPageModelResolver.ResolvePageModel <MainMenuPageModel>(cuidador);
            var mainPage = new FreshNavigationContainer(page);

            MainPage = mainPage;
        }
Exemplo n.º 10
0
        public void SwitchNavigation(NavigacionStacks navigationPila, FreshBasePageModel page)
        {
            switch (navigationPila)
            {
            case NavigacionStacks.Autentificacion:

                var login    = FreshPageModelResolver.ResolvePageModel <LoginViewModel>();
                var NavLogin = new FreshNavigationContainer(login, navigationPila.ToString());

                page.CoreMethods.SwitchOutRootNavigation(navigationPila.ToString());

                break;

            case NavigacionStacks.Inicio:
                var VInicio   = FreshPageModelResolver.ResolvePageModel <ContactsViewModel>();
                var NavInicio = new FreshNavigationContainer(VInicio, navigationPila.ToString());

                page.CoreMethods.SwitchOutRootNavigation(navigationPila.ToString());

                break;

            case NavigacionStacks.MasterD:
                break;
            }
        }
Exemplo n.º 11
0
        public MasterDetailNavigationPage()
        {
            var detailpage = FreshPageModelResolver.ResolvePageModel <ViewModels.ResidencesPageModel>();

            var masterpage = FreshPageModelResolver.ResolvePageModel <ViewModels.MasterPageModel>();

            var context = masterpage.BindingContext as MasterPageModel;

            if (context != null)
            {
                context.MenuItemSelected += Context_MenuItemSelected;
            }

            #region Setup

            masterpage.Title = " ";
            //masterpage.Icon = "menu.png";

            // stop master from splitscreen view in landscape
            MasterBehavior = MasterBehavior.Popover;

            // Disable swipe left to right for opening navigation drawer
            IsGestureEnabled = false;

            #endregion

            Detail_navigation = new FreshNavigationContainer(detailpage)
            {
                BarTextColor = Color.Black, BarBackgroundColor = Color.White
            };

            Master = masterpage;

            Detail = Detail_navigation;
        }
Exemplo n.º 12
0
        void SetupLoginNav()
        {
            // Login navigation & stuff https://github.com/rid00z/FreshMvvm
            var loginPage = FreshPageModelResolver.ResolvePageModel <LoginPageModel>();

            loginContainer = new FreshNavigationContainer(loginPage, NavigationContainerNames.AuthenticationContainer);
        }
Exemplo n.º 13
0
        public App()
        {
            InitializeComponent();


            Page page;
            FreshNavigationContainer container;

            if (Current.Properties.ContainsKey("DisclaimerAgree"))
            {
                page      = FreshPageModelResolver.ResolvePageModel <ModesPageModel>();
                container = new FreshNavigationContainer(page)
                {
                    BarTextColor = Color.White, BarBackgroundColor = Color.Black
                };
            }
            else
            {
                page      = FreshPageModelResolver.ResolvePageModel <DisclaimerPageModel>();
                container = new FreshNavigationContainer(page)
                {
                    BarTextColor = Color.Black, BarBackgroundColor = Color.White
                };
            }

            MainPage = container;
        }
Exemplo n.º 14
0
        private void LoadBasicNav()
        {
            var login = FreshPageModelResolver.ResolvePageModel <LoginPageModel>();

            navContainer = new FreshNavigationContainer(login);
            MainPage     = navContainer;
        }
Exemplo n.º 15
0
        private void SetupSingleNav()
        {
            var page      = FreshPageModelResolver.ResolvePageModel <MenuPageModel>(null);
            var singleNav = new FreshNavigationContainer(page);

            this.MainPage = singleNav;
        }
        protected async Task PushModalNavigationPageAsync <T>() where T : FreshBasePageModel
        {
            var page = FreshMvvm.FreshPageModelResolver.ResolvePageModel <T>();
            var navigationContainer = new FreshNavigationContainer(page);

            await CoreMethods.PushNewNavigationServiceModal(navigationContainer, new FreshBasePageModel[] { page.GetModel() });
        }
Exemplo n.º 17
0
        public override async void Init(object initData)
        {
            base.Init(initData);

            try
            {
                await BuscarInformacionParaLogin();

                if (App.Persona != null && App.Usuario != null)
                {
                    App.Persona.Usuarios            = App.Usuario;
                    App.Persona.PersonaRecordandose = true;

                    App.IdiomaPersona = App.Persona.IdiomaDeLaPersona;
                    App.ConfigureCultureIdiomsApp(App.Persona.IdiomaDeLaPersona);

                    BadgeColorTabbedNavigationContainer tabbedPage = App.ConfigureTabbedNavigationContainer(App.Persona, App.Usuario);
                    CoreMethods.SwitchOutRootNavigation(NavigationContainerNames.MainTabbedContainer);
                    tabbedPage.CurrentPage = tabbedPage.Children[2];
                }
                else
                {
                    FreshNavigationContainer basicNavContainer = App.ConfigureNavigationContainer();
                    CoreMethods.SwitchOutRootNavigation(NavigationContainerNames.AuthenticationContainer);
                    ClearInfoUsuario();
                }
            }
            catch (Exception)
            {
                FreshNavigationContainer basicNavContainer = App.ConfigureNavigationContainer();
                CoreMethods.SwitchOutRootNavigation(NavigationContainerNames.AuthenticationContainer);
                ClearInfoUsuario();
            }
        }
Exemplo n.º 18
0
        public NewOrderPageModel()
        {
            CreateOrderCommand = new Command(
                execute: async() =>
            {
                if (rooms == null || rooms.Count == 0)
                {
                    await Application.Current.MainPage.DisplayAlert("No Rooms selected", "Please select at least one room!", "Ok");
                    return;
                }
                var order = new Order()
                {
                    Costumer  = User,
                    StartDate = this.StartDate,
                    EndDate   = this.EndDate,
                    Rooms     = rooms,
                    Price     = this.Price
                };

                using (HttpClient client = new HttpClient())
                {
                    client.BaseAddress = baseAddress;

                    var response = await client.PostAsJsonAsync <Order>("api/Order/create", order);
                    if (response.StatusCode == System.Net.HttpStatusCode.Created)
                    {
                        var navpage = new FreshNavigationContainer(FreshPageModelResolver.ResolvePageModel <MainPageModel>(User));
                        Application.Current.MainPage = navpage;
                    }
                }
            }
                );
        }
Exemplo n.º 19
0
        public App()
        {
            var page = FreshPageModelResolver.ResolvePageModel <FirstPageModel>();
            var basicNavContainer = new FreshNavigationContainer(page);

            MainPage = basicNavContainer;
        }
Exemplo n.º 20
0
        public static FreshNavigationContainer notesHome()
        {
            var mainpage         = FreshPageModelResolver.ResolvePageModel <NotesListPageModel>();
            var mainNavContainer = new FreshNavigationContainer(mainpage, "NotesListPageNav");

            return(mainNavContainer);
        }
Exemplo n.º 21
0
 protected void SetupAllPagesNav()
 {
     _homeNav    = new FreshNavigationContainer(FreshPageModelResolver.ResolvePageModel <HomePageModel>(), "HomePageNav");
     _archiveNav = new FreshNavigationContainer(FreshPageModelResolver.ResolvePageModel <ArchivePageModel>(), "ArchivePageNav");
     _reportNav  = new FreshNavigationContainer(FreshPageModelResolver.ResolvePageModel <ReportPageModel>(), "ArchivePageNav");
     _settingNav = new FreshNavigationContainer(FreshPageModelResolver.ResolvePageModel <SettingPageModel>(), "ArchivePageNav");
 }
Exemplo n.º 22
0
        private FreshNavigationContainer CreateMasterDetailNavigationContainer()
        {
            var main             = FreshPageModelResolver.ResolvePageModel <MainPageModel>();
            var masterNavigation = new FreshNavigationContainer(main);

            return(masterNavigation);
        }
Exemplo n.º 23
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);
        }
Exemplo n.º 24
0
        public App()
        {
            InitializeComponent();

            On <Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);

            SetUpIoC();

            Page loginPage = FreshPageModelResolver.ResolvePageModel <AuthorizationPageModel>();
            FreshNavigationContainer loginContainer = new FreshNavigationContainer(loginPage, NavigationContainerNames.AuthenticationContainer);

            ExtendedTabbedPage tabbedNavigation = SetUpTabbedNavigation();

            Current.On <Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Pan);

            Realm             realm = Realm.GetInstance();
            IQueryable <User> user  = realm.All <User>();
            bool UserIsFound        = user?.Count() > 0;

            if (!IsUserLoggedIn & !UserIsFound)
            {
                MainPage = loginContainer;
            }
            else
            {
                MainPage = tabbedNavigation;
            }
        }
Exemplo n.º 25
0
        public void LoadBasicNav()
        {
            var page = FreshPageModelResolver.ResolvePageModel <MainMenuPageModel>();
            var basicNavContainer = new FreshNavigationContainer(page);

            MainPage = basicNavContainer;
        }
Exemplo n.º 26
0
        public void LoadMultipleNavigation()
        {
            var masterDetailsMultiple = new MasterDetailPage(); //generic master detail page

            //we setup the first navigation container with ContactList
            var contactListPage = FreshPageModelResolver.ResolvePageModel <ContactListPageModel>();

            contactListPage.Title = "Contact List";
            //we setup the first navigation container with name MasterPageArea
            var masterPageArea = new FreshNavigationContainer(contactListPage, "MasterPageArea");

            masterPageArea.Title = "Menu";

            masterDetailsMultiple.Master = masterPageArea; //set the first navigation container to the Master

            //we setup the second navigation container with the QuoteList
            var quoteListPage = FreshPageModelResolver.ResolvePageModel <QuoteListPageModel>();

            quoteListPage.Title = "Quote List";
            //we setup the second navigation container with name DetailPageArea
            var detailPageArea = new FreshNavigationContainer(quoteListPage, "DetailPageArea");

            masterDetailsMultiple.Detail = detailPageArea; //set the second navigation container to the Detail

            MainPage = masterDetailsMultiple;
        }
Exemplo n.º 27
0
        public void GoToLogin()
        {
            var page = FreshPageModelResolver.ResolvePageModel <LoginViewModel>();
            var basicNavContainer = new FreshNavigationContainer(page);

            MainPage = basicNavContainer;
        }
 public App()
 {
     InitializeComponent();
     JdsClient.BaseAddress = "http://developers.gpseyetrackerph.com/";
     DependencyInjectionTool.Register();
     MainPage = new FreshNavigationContainer(FreshPageModelResolver.ResolvePageModel <LoginPageModel>());
 }
Exemplo n.º 29
0
        public App()
        {
            InitializeComponent();
            var page = FreshPageModelResolver.ResolvePageModel <MainPageModel>();
            var basicNavContainer = new FreshNavigationContainer(page);

            MainPage = basicNavContainer;
        }
Exemplo n.º 30
0
        private void DisplayTasksPage()
        {
            var tasksPage = FreshPageModelResolver.ResolvePageModel <TasksPageModel>();

            var tasksPageContainer = new FreshNavigationContainer(tasksPage, "TasksPageContainer");

            Application.Current.MainPage = tasksPageContainer;
        }
		public void Test_Register_IFreshNavigationService()
		{
			var page = new MockContentPage();

			var navigation = new FreshNavigationContainer(page);
			var navigationService = FreshIOC.Container.Resolve<IFreshNavigationService>();

			Assert.IsNotNull(navigationService);
			Assert.AreEqual(navigation, navigationService);
		}
		public async Task Test_PushPage_Modal()
		{
			var mainPageViewModel = new MockFreshBasePageModel();
			var mainPage = new MockContentPage();
			var detailsPage = new MockContentPage();
			var navigation = new FreshNavigationContainer(mainPage);

			Assert.That(navigation.Navigation.ModalStack.Count, Is.EqualTo(0));

			await navigation.PushPage(detailsPage, mainPageViewModel, true);

			Assert.That(navigation.Navigation.ModalStack.Count, Is.EqualTo(1));
		}
		public async Task Test_PushPage()
		{
			var mainPageViewModel = new MockFreshBasePageModel();
			var mainPage = new MockContentPage();
			var detailsPage = new MockContentPage();
			var navigation = new FreshNavigationContainer(mainPage);

			await navigation.PushPage(detailsPage, mainPageViewModel);

			var page = navigation.Navigation.NavigationStack.FirstOrDefault(p => p.Id.Equals(detailsPage.Id));

			Assert.IsNotNull(page);
			Assert.AreSame(detailsPage, page);
		}
        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");
        }
        void PushSecondNavigationStack()
        {
            _coreMethods = new PageModelCoreMethods (_page, _pageModel);
            _coreMethods.PushPageModel<MockContentPageModel> ();

            _pageSecond = FreshPageModelResolver.ResolvePageModel<MockContentPageModel>();
            _pageModelSecond = _pageSecond.BindingContext as MockContentPageModel;   
            _coreMethodsSecondPage = new PageModelCoreMethods (_pageSecond, _pageModelSecond);
            _secondNavService = new FreshNavigationContainer (_pageSecond, "secondNav");

            _coreMethods.PushNewNavigationServiceModal (_secondNavService, new FreshBasePageModel[] { _pageModelSecond });
        }
		public async Task Test_PopToRoot()
		{
			var mainPage = new MockContentPage();
			var navigation = new FreshNavigationContainer(mainPage);

			await navigation.PushPage(new MockContentPage(), new MockFreshBasePageModel());
			await navigation.PushPage(new MockContentPage(), new MockFreshBasePageModel());
			await navigation.PopToRoot();

			var firstPage = navigation.Navigation.NavigationStack.FirstOrDefault();

			Assert.IsNotNull(firstPage);
			Assert.AreSame(mainPage, firstPage);
		}