async Task PushPageModelWithPage(Page page, FreshBasePageModel pageModel, object data, bool modal = false) { pageModel.PreviousPageModel = _currentPageModel; //This is the previous page model because it's push to a new one, and this is current pageModel.CurrentNavigationServiceName = _currentPageModel.CurrentNavigationServiceName; if (string.IsNullOrWhiteSpace(pageModel.PreviousNavigationServiceName)) { pageModel.PreviousNavigationServiceName = _currentPageModel.PreviousNavigationServiceName; } if (page is FreshMasterDetailNavigationContainer) { this.PushNewNavigationServiceModal((FreshMasterDetailNavigationContainer)page, pageModel); } else if (page is FreshTabbedNavigationContainer) { this.PushNewNavigationServiceModal((FreshTabbedNavigationContainer)page, pageModel); } else { IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (_currentPageModel.CurrentNavigationServiceName); await rootNavigation.PushPage(page, pageModel, modal); } }
void SetupFirstNavigationAndPage() { _navigationMock = Substitute.For <IFreshNavigationService> (); FreshIOC.Container.Register <IFreshNavigationService> (_navigationMock, "firstNav"); _page = FreshPageModelResolver.ResolvePageModel <MockContentPageModel>(); _pageModel = _page.BindingContext as MockContentPageModel; _pageModel.CurrentNavigationServiceName = "firstNav"; }
public async Task PopModalNavigationService() { var currentNavigationService = FreshIOC.Container.Resolve <IFreshNavigationService> (_currentPageModel.CurrentNavigationServiceName); currentNavigationService.NotifyChildrenPageWasPopped(); var navServiceName = _currentPageModel.PreviousNavigationServiceName; IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (navServiceName); await rootNavigation.PopPage(true); }
async Task PushPageModel(FreshBasePageModel pageModel, object data, bool modal = false) { var page = FreshPageModelResolver.ResolvePageModel(data, pageModel); pageModel.PreviousPageModel = _pageModel; IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (); await rootNavigation.PushPage(page, pageModel, modal); }
public void SwitchOutRootNavigation(string navigationServiceName) { IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (navigationServiceName); if (!(rootNavigation is Page)) { throw new Exception("Navigation service is not a page"); } Xamarin.Forms.Application.Current.MainPage = rootNavigation as Page; }
public async Task PopPageModel(bool modal = false) { string navServiceName = _currentPageModel.CurrentNavigationServiceName; if (_currentPageModel.IsModalFirstChild) { navServiceName = _currentPageModel.PreviousNavigationServiceName; } IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (navServiceName); await rootNavigation.PopPage(modal); }
async Task OnAddBonusEvent() { ScannerBonusesPage page = new ScannerBonusesPage(); page.OnScannedCode += async(code) => { await OnScannedCode(code); }; IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService>(Constants.DefaultNavigationServiceName); await rootNavigation.PushPage(page, null); }
async Task PushPageModel(FreshBasePageModel pageModel, object data, bool modal = false) { var page = FreshPageModelResolver.ResolvePageModel(data, pageModel); pageModel.PreviousPageModel = _currentPageModel; //This is the previous page model because it's push to a new one, and this is current pageModel.CurrentNavigationServiceName = _currentPageModel.CurrentNavigationServiceName; if (string.IsNullOrWhiteSpace(pageModel.PreviousNavigationServiceName)) { pageModel.PreviousNavigationServiceName = _currentPageModel.PreviousNavigationServiceName; } IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (_currentPageModel.CurrentNavigationServiceName); await rootNavigation.PushPage(page, pageModel, modal); }
public async Task PushNewNavigationServiceModal(IFreshNavigationService newNavigationService, FreshBasePageModel[] basePageModels) { var navPage = newNavigationService as Page; if (navPage == null) { throw new Exception("Navigation service is not Page"); } foreach (var pageModel in basePageModels) { pageModel.CurrentNavigationServiceName = newNavigationService.NavigationServiceName; pageModel.PreviousNavigationServiceName = _currentPageModel.CurrentNavigationServiceName; pageModel.IsModalFirstChild = true; } IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (_currentPageModel.CurrentNavigationServiceName); await rootNavigation.PushPage(navPage, null, true); }
public async Task PopPageModel(bool modal = false) { string navServiceName = _currentPageModel.CurrentNavigationServiceName; if (_currentPageModel.IsModalFirstChild) { await PopModalNavigationService(); } else { if (modal) { this._currentPageModel.RaisePageWasPopped(); } IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (navServiceName); await rootNavigation.PopPage(modal); } }
public Task PushNewNavigationServiceModal(IFreshNavigationService newNavigationService, FreshBasePageModel basePageModels, bool animate = true) { throw new NotImplementedException(); }
public Task PushNewNavigationServiceModal(IFreshNavigationService newNavigationService, FreshBasePageModel basePageModels) { return(PushNewNavigationServiceModal(newNavigationService, new FreshBasePageModel[] { basePageModels })); }
public async Task PopToRoot(bool animate) { IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (_currentPageModel.CurrentNavigationServiceName); await rootNavigation.PopToRoot(animate); }
public async Task PopToRoot(bool animate) { IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (); await rootNavigation.PopToRoot(animate); }
public async Task PopPageModel(bool modal = false) { IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (); await rootNavigation.PopPage(modal); }
public async Task PopPage() { IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService>(Constants.DefaultNavigationServiceName); await rootNavigation.PopPage(); }
public Task PushNewNavigationServiceModal(IFreshNavigationService newNavigationService, FreshBasePageModel basePageModels, bool animate = true) { return(PushNewNavigationServiceModal(newNavigationService, new FreshBasePageModel[] { basePageModels }, animate)); }
public async Task PopModalNavigationService() { var navServiceName = _currentPageModel.PreviousNavigationServiceName; IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService> (navServiceName); await rootNavigation.PopPage(true); }
void SetupFirstNavigationAndPage() { _navigationMock = Substitute.For<IFreshNavigationService> (); FreshIOC.Container.Register<IFreshNavigationService> (_navigationMock, "firstNav"); _page = FreshPageModelResolver.ResolvePageModel<MockContentPageModel>(); _pageModel = _page.BindingContext as MockContentPageModel; _pageModel.CurrentNavigationServiceName = "firstNav"; }
public Task PushNewNavigationServiceModal(IFreshNavigationService newNavigationService, FreshBasePageModel[] basePageModels) { throw new NotImplementedException(); }
public async Task PopToPageIndex(int pageIndex, bool animate = true) { IFreshNavigationService rootNavigation = FreshIOC.Container.Resolve <IFreshNavigationService>(_currentPageModel.CurrentNavigationServiceName); await rootNavigation.PopToPageIndex(pageIndex, animate); }