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); }