Пример #1
0
        private async void OnImageTapped(Object sender, EventArgs e)
        {
            var selectedItem = (SocialGalleryImage)sender;
            var socialGalleryImagePreview = new SocialGalleryImagePreviewPage(selectedItem.Image);

            await Navigation.PushModalAsync(NavigationPageHelper.Create(socialGalleryImagePreview));
        }
Пример #2
0
        public async Task NavigateToSample(INavigation navigation)
        {
            SampleCoordinator.RaiseSampleSelected(this);

            if (_justNotifyNavigateIntent)
            {
                return;
            }

            if (_customNavigation != null)
            {
                _customNavigation(navigation);
                return;
            }

            int popCount            = 0;
            int firstPageToPopIndex = 0;

            if (_pageType == typeof(RootPage))
            {
                // navigation.PopToRootAsync() does't work in old Android versions
                // and we need to go back to the top anyways
                popCount = navigation.NavigationStack.Count - 1;
            }
            else
            {
                for (int i = navigation.NavigationStack.Count - 1; i >= 0; i--)
                {
                    if (navigation.NavigationStack[i].GetType() == _pageType)
                    {
                        firstPageToPopIndex = i + 1;
                        popCount            = navigation.NavigationStack.Count - 1 - i;
                        break;
                    }
                }
            }

            if (popCount > 0)
            {
                for (int i = 1; i < popCount; i++)
                {
                    navigation.RemovePage(navigation.NavigationStack[firstPageToPopIndex]);
                }

                await navigation.PopAsync();

                return;
            }

            var page = CreateContentPage();

            if (_modal)
            {
                await navigation.PushModalAsync(NavigationPageHelper.Create(page));
            }
            else
            {
                await navigation.PushAsync(page);
            }
        }
Пример #3
0
        public RootPage(bool sayWelcome)
        {
            InitializeComponent();

            _showWelcome = sayWelcome;

            // Empty pages are initially set to get optimal launch experience
            Master = new ContentPage {
                Title = "Grial"
            };
            Detail = NavigationPageHelper.Create(new ContentPage());
        }
Пример #4
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            SampleCoordinator.SampleSelected += SampleCoordinator_SampleSelected;

            if (_showWelcome)
            {
                _showWelcome = false;

                await Navigation.PushModalAsync(NavigationPageHelper.Create(new WelcomePage()));

                await Task.Delay(500)
                .ContinueWith(t => NavigationService.BeginInvokeOnMainThreadAsync(InitializeMasterDetail));
            }
            else
            {
                InitializeMasterDetail();
            }
        }
Пример #5
0
        private async void OnImageTapped(Object sender, EventArgs e)
        {
            var imagePreview = new ProductImageFullScreenPage((sender as FFImageLoading.Forms.CachedImage).Source);

            await Navigation.PushModalAsync(NavigationPageHelper.Create(imagePreview));
        }
Пример #6
0
 private void LaunchSampleInDetail(Page page, bool animated)
 {
     Detail      = NavigationPageHelper.Create(page);
     IsPresented = false;
 }
Пример #7
0
 private void InitializeMasterDetail()
 {
     Master = new MainMenuPage(new NavigationService(Navigation, LaunchSampleInDetail));
     Detail = NavigationPageHelper.Create(new DashboardPage());
 }