Exemplo n.º 1
0
 private void Current_Navigated(object sender, ShellNavigatedEventArgs e)
 {
     if (e.Source == ShellNavigationSource.Pop && !suppressExtraPop)
     {
         vmStack.Pop();
     }
 }
Exemplo n.º 2
0
        protected override void OnNavigated(ShellNavigatedEventArgs args)
        {
            base.OnNavigated(args);

            if (args.Current.Location.OriginalString.Contains("sessions"))
            {
                App.Current.Resources["CurrentAccentColor"] = App.Current.Resources["AppPrimaryColor"];
            }
            else if (args.Current.Location.OriginalString.Contains("favorits"))
            {
                App.Current.Resources["CurrentAccentColor"] = App.Current.Resources["FavoritListShellColor"];
            }
            else if (args.Current.Location.OriginalString.Contains("watched"))
            {
                App.Current.Resources["CurrentAccentColor"] = App.Current.Resources["WatchedListShellColor"];
            }
            else
            {
                throw new ArgumentException(message: "Navigated from Unknown Page exception.");
            }

            var color = (Xamarin.Forms.Color)App.Current.Resources["CurrentAccentColor"];

            this._statusBarColorManager.SetColor(color, false);
        }
Exemplo n.º 3
0
 private void OnNavigatedTo(object sender, ShellNavigatedEventArgs e)
 {
     if (e.Current.Location.OriginalString.Contains(((BaseShellItem)Parent).Route.ToString()))
     {
         RefrescarUsuarios();
     }
 }
        void OnShellNavigated(object sender, ShellNavigatedEventArgs e)
        {
            var page = Shell.CurrentItem.CurrentItem as ShellSection;

            CurrentPage = ((IShellSectionController)page).PresentedPage;
            Preferences.Set("LastKnownUrl", e.Current.Location.OriginalString);
        }
Exemplo n.º 5
0
        protected override async void OnNavigated(ShellNavigatedEventArgs args)
        {
            base.OnNavigated(args);

            UpdateStatusBarColour();
            await UpdateTabBarVisibility();
        }
Exemplo n.º 6
0
 private async void OnNavigatedTo(object sender, ShellNavigatedEventArgs e)
 {
     if (e.Current.Location.OriginalString.Contains(((BaseShellItem)Parent).Route.ToString()))
     {
         await Global.Get_Articulos();
     }
 }
        protected override void OnNavigated(ShellNavigatedEventArgs args)
        {
            base.OnNavigated(args);

            Debug.WriteLine($"NavigatED From: {args.Previous?.Location?.ToString() ?? "-"}; To:  {args.Current?.Location?.ToString() ?? "-"}; By: {args.Source.ToString()};");

            if (!_started)
            {
                return;
            }

            var shellSection = Shell.Current?.CurrentItem;
            var shellContent = shellSection?.CurrentItem;
            var items        = shellContent?.Items;
            var stack        = shellContent?.Stack;

            Debug.WriteLine($"Stack Count: {stack?.Count ?? -1}");

            /*
             * Now using the Pre-nav option
             * if (args.Current?.Location.ToString().Equals("//home/myhealth/default", System.StringComparison.InvariantCultureIgnoreCase) == true && !PrototypeService.IsUserAuthenticated)
             * {
             *  // just push to new page
             *  await GoToAsync("myhealth/guest", false).ConfigureAwait(false);
             * }*/
        }
Exemplo n.º 8
0
 void OnNavigated(object sender, ShellNavigatedEventArgs arg)
 {
     if (arg.Current != null)
     {
         CurrentUri = arg.Current.Location.ToString();
     }
 }
Exemplo n.º 9
0
 protected async override void OnNavigated(ShellNavigatedEventArgs args)
 {
     if (!App.Connection)
     {
         await this.DisplayAlert("", "Отсутствует соединение с сетью Интернет!", "ОК");
     }
 }
Exemplo n.º 10
0
        protected override async void OnNavigated(ShellNavigatedEventArgs args)
        {
            base.OnNavigated(args);

            if (firstNavigated)
            {
                firstNavigated = false;
                ContentPage contentPage = new ContentPage();
                contentPage.Content = new Label()
                {
                    Text = "If you don't see any bottom tabs the test has failed"
                };
                Shell.SetTabBarIsVisible(contentPage, true);

                ContentPage contentPage2 = new ContentPage();
                contentPage2.Content =
                    new StackLayout()
                {
                    Children =
                    {
                        new Label()
                        {
                            Text         = "Click The Back Arrow",
                            AutomationId = "TestReady"
                        }
                    }
                };

                Shell.SetTabBarIsVisible(contentPage2, false);
                await Navigation.PushAsync(contentPage);

                await Navigation.PushAsync(contentPage2);
            }
        }
Exemplo n.º 11
0
        public async Task NavigatingAndNavigatedFiresForShellModal()
        {
            Shell shell = new Shell();

            shell.Items.Add(CreateShellItem(shellItemRoute: "NewRoute", shellSectionRoute: "Section", shellContentRoute: "Content"));

            ShellNavigatingEventArgs shellNavigatingEventArgs = null;
            ShellNavigatedEventArgs  shellNavigatedEventArgs  = null;

            shell.Navigating += (_, args) =>
            {
                shellNavigatingEventArgs = args;
            };

            shell.Navigated += (_, args) =>
            {
                shellNavigatedEventArgs = args;
            };

            await shell.GoToAsync("ModalTestPage");

            Assert.IsNotNull(shellNavigatingEventArgs, "Shell.Navigating never fired");
            Assert.IsNotNull(shellNavigatedEventArgs, "Shell.Navigated never fired");

            Assert.AreEqual("//NewRoute/Section/Content/", shellNavigatingEventArgs.Current.FullLocation.ToString());
            Assert.AreEqual("//NewRoute/Section/Content/ModalTestPage", shellNavigatedEventArgs.Current.FullLocation.ToString());
        }
Exemplo n.º 12
0
 private void OnNavigatedTo(object sender, ShellNavigatedEventArgs e)
 {
     if (e.Current.Location.OriginalString.Contains(((BaseShellItem)Parent).Route.ToString()))
     {
         ActualizarMapaMesas();
     }
 }
Exemplo n.º 13
0
 protected override void OnNavigated(ShellNavigatedEventArgs args)
 {
     LastShellNavigatedEventArgs = args;
     base.OnNavigated(args);
     OnNavigatedHandler?.Invoke(args);
     OnNavigatedCount++;
 }
Exemplo n.º 14
0
 protected override void OnNavigated(ShellNavigatedEventArgs args)
 {
     if (args.Source == ShellNavigationSource.ShellSectionChanged && Current.Navigation.NavigationStack.Count > 1)
     {
         Current.Navigation.PopToRootAsync(animated: false);
     }
     base.OnNavigated(args);
 }
 /// <summary>
 /// Event handler for navigation completion
 /// </summary>
 /// <param name="sender">The sender</param>
 /// <param name="e">The event args</param>
 private void OnNavigated(object sender, ShellNavigatedEventArgs e)
 {
     if (this.navigationService == null && Shell.Current != null)
     {
         this.navigationService = DependencyHelper.Resolve <INavigationService>();
         this.navigationService.Initialise(Shell.Current);
     }
 }
Exemplo n.º 16
0
 private void OnNavigated(object sender, ShellNavigatedEventArgs e)
 {
     // Cancel any back navigation
     //if (e.Source == ShellNavigationSource.Pop)
     //{
     //    e.Cancel();
     //}
 }
Exemplo n.º 17
0
 private async void OnNavigatedTo(object sender, ShellNavigatedEventArgs e)
 {
     if (e.Current.Location.OriginalString.Contains(((BaseShellItem)Parent).Route.ToString()))
     {
         if (Global.UsuarioActual != null)
         {
             await Shell.Current.GoToAsync("//Principal");
         }
     }
 }
Exemplo n.º 18
0
 /// <inheritdoc/>
 protected override void OnNavigated(ShellNavigatedEventArgs e)
 {
     base.OnNavigated(e);
     // Once MainPage is shown, hide the "Loading..." Flyout, as the user shouldn't be
     // able to navigate to that page.
     if (e.Current.Location.ToString().Contains(nameof(MainPage)))
     {
         this.LoadingFlyout.IsVisible = false;
     }
 }
Exemplo n.º 19
0
        private async void OnNavigatedTo(object sender, ShellNavigatedEventArgs e)
        {
            if (e.Current.Location.OriginalString.Contains(((BaseShellItem)Parent).Route.ToString()))
            {
                await Global.Get_Ajustes();

                CargandoAjustes = true;

                ComenzarJornadaConArticulosDisponibles.On = Global.Ajustes.ComenzarJornadaConArticulosDisponibles;

                CargandoAjustes = false;
            }
        }
Exemplo n.º 20
0
        protected override void OnNavigated(ShellNavigatedEventArgs args)
        {
            base.OnNavigated(args);

            Analytics.TrackEvent(TrackingEvents.NavigatedTo,
                                 new TrackingEvents.NavigatedToArgs(args.Current.Location.OriginalString));


            if (Device.RuntimePlatform == Device.Android && DeviceInfo.Version.Major < 6)
            {
                GC.Collect();
                GC.WaitForPendingFinalizers();
            }
        }
Exemplo n.º 21
0
 protected override async void OnNavigated(ShellNavigatedEventArgs args)
 {
     if (args.Current.Location.OriginalString == "//Quiz")
     {
         if (App._words.Count > 1)
         {
             await Shell.Current.GoToAsync("//QuizPage");
         }
         else
         {
             await DisplayAlert("", "Add more than 10 words to activate the quiz!", "Ok"); //who stole the toast?
         }
     }
 }
Exemplo n.º 22
0
        protected virtual async Task OnShellNavigated(string sender, ShellNavigatedEventArgs args)
        {
            ShellNavigatedEventArgs = args;

            if (AppNavigationService.NavigationDirection == NavigationDirection.Backwards)
            {
                AppInitialiserService.Initialise(this);
            }

            OnNavigatedComplete?.Invoke();

            // reset navigation direction
            AppNavigationService.NavigationDirection = NavigationDirection.Forward;
        }
        protected override void OnNavigated(ShellNavigatedEventArgs args)
        {
            base.OnNavigated(args);
            try
            {
                var vmlResult = Prism.Mvvm.ViewModelLocator.GetAutowireViewModel(LastPage);
                if (vmlResult == null)
                {
                    Prism.Mvvm.ViewModelLocator.SetAutowireViewModel(LastPage, true);
                }

                PageUtilities.OnNavigatedTo(LastPage, Parameters);
                Parameters = null;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine($"EXCEPITON: {this?.GetType()?.Name}.OnNavigated() \n{ex.Message}\n{ex}");
            }
        }
        protected override async Task OnShellNavigated(string sender, ShellNavigatedEventArgs args)
        {
            await base.OnShellNavigated(sender, args);

            if (!IsAddProduct)
            {
                HeaderText = "Edit Product";

                SelectedProductType     = ProductTypes.Where(l => l.ProductTypeId.Equals(Product.ProductTypeId)).FirstOrDefault();
                ProductCategories       = App.MasterData.ProductCategoryList.Where(l => l.ProductTypeId.Equals(Product.ProductTypeId)).ToList();
                SelectedProductCategory = ProductCategories.Where(l => l.ProductCategoryId.Equals(Product.ProductCategoryId)).FirstOrDefault();
            }
            else
            {
                HeaderText = "Add Product";
                //SelectedProductCategory = null;
                //SelectedProductType = ProductTypes[0];
                //ProductCategories = null;
            }

            /*if(Product != null)
             * {
             *  ProductTypes.DefaultItem = ProductTypes.ControlValues.Where(x => x.ItemId.Equals(Product.ProductTypeId)).FirstOrDefault();
             *  //if(!string.IsNullOrEmpty(Product.ProductNameId))
             *  //{
             *  //    DefaultProductName = ProductNames.Where(l => l.ParentId.Equals(Product.ProductTypeId)).FirstOrDefault();
             *
             *  //}
             *  //DefaultProductName.SelectedIndex =
             * }
             * else if(ProductTypes == null)
             * {
             *  var productItems = InitializeProduct();
             *  ProductTypes = productItems.Item1;
             *  ProductNames = productItems.Item2;
             *  Product = productItems.Item3;
             *  DefaultProductName = productItems.Item2[0];
             * }*/

            //ProductCategories = App.MasterData.ProductCategoryList.Where(l => l.ProductTypeId.Equals(ProductTypes[0].ProductTypeId)).ToList();
        }
Exemplo n.º 25
0
 private void OnShellNavigated(object sender, ShellNavigatedEventArgs e)
 {
     // If we have just arrived after sign out and for some reason this page hasn't been destroyed!
     // We must reset the original visual states of the beginning transition items;
     if (e.Current?.Location.OriginalString == "//Login" && e.Previous?.Location.OriginalString == "//Settings")
     {
         animationStarted       = false;
         MaterialFrame.Opacity  = 0;
         LogoImage.TranslationY = 0;
         TitleSL.Opacity        = 0;
         TitleSL.TranslationY   = 200;
         ChevronSL.Opacity      = 0;
         foreach (Frame f in ButtonSL.Children)
         {
             f.Opacity = 0;
         }
         if (!imageLoaded)
         {
             BackgrndImage.ReloadImage();
         }
     }
 }
Exemplo n.º 26
0
        protected override async void OnNavigated(ShellNavigatedEventArgs args)
        {
            base.OnNavigated(args);

            if (firstNavigated)
            {
                firstNavigated = false;
                ContentPage contentPage = new ContentPage();
                contentPage.Content = new Label()
                {
                    Text         = "Click the Coffee Cup in the Nav Bar",
                    AutomationId = "TestReady"
                };

                Shell.SetTabBarIsVisible(contentPage, false);
                Shell.SetBackButtonBehavior(contentPage, new BackButtonBehavior()
                {
                    IconOverride = "coffee.png"
                });
                await Navigation.PushAsync(contentPage);
            }
        }
Exemplo n.º 27
0
 private void OnShellNavigated(object sender, ShellNavigatedEventArgs e)
 {
     // If we have just arrived after sign out and for some reason this page hasn't been destroyed!
     // We must reset the original visual states of the beginning transition items;
     if (e.Current?.Location.OriginalString == "//Login")
     {
         animationStarted       = false;
         MaterialFrame.Opacity  = 0;
         LogoImage.TranslationY = 0;
         TitleSL.Opacity        = 0;
         TitleSL.TranslationY   = 200;
         ChevronSL.Opacity      = 0;
         EmailEntry.IsEnabled   = PasswordEntry.IsEnabled = PasswordConfirmationEntry.IsEnabled = false;
         foreach (VisualElement v in InputSL.Children)
         {
             v.Opacity = 0;
         }
         if (!imageLoaded)
         {
             BackgrndImage.ReloadImage();
         }
     }
 }
Exemplo n.º 28
0
 private void OnNavigated(object sender, ShellNavigatedEventArgs e)
 {
     /*
      * https://github.com/xamarin/Xamarin.Forms/issues/6098
      *
      * Debug.WriteLine(sender);
      * Debug.WriteLine(e);
      * var source = e.Source;
      * var currentLocation = e.Current.Location;
      *
      * //go find this page and fire off OnAppearing();
      * var shell = (Shell)sender;  //this
      *
      * var flyoutItem_Home = this.Items[0];
      *
      * //var appTabs = flyoutItem_Home.Tabs;
      *
      * var welcomeTab = flyoutItem_Home.Items[0];
      *
      * var currentPage = welcomeTab.CurrentItem.Content as Page;
      * var currentVM = currentPage.BindingContext as BaseViewModel;
      *
      * this.Items.Where(x => x.Route == currentLocation.ToString()).FirstOrDefault();*/
 }
Exemplo n.º 29
0
 void OnNavigated(object sender, ShellNavigatedEventArgs e)
 {
 }
Exemplo n.º 30
0
 protected override void OnNavigated(ShellNavigatedEventArgs args)
 {
     base.OnNavigated(args);
     UpdateStatusBarColour();
 }