Exemple #1
0
        private void OnNativeBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            var args = new BackRequestedEventArgs();

            BackRequested?.Invoke(this, args);
            e.Handled = args.Handled;
        }
        private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }

            // Navigate back if possible, and if the event has not
            // already been handled .
            // Navigate back if possible, and if the event has not
            // already been handled .
            if (rootFrame.CanGoBack && e.Handled == false)
            {
                Windows.Storage.ApplicationDataCompositeValue composite = (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["nowReading"];
                composite["chapter"] = returnIndex;// this.MasterListView.SelectedIndex;
                composite["count"]   = this.MasterListView.Items.Count;
                composite["offset"]  = panoOn ? this.panoView.HorizontalOffset : this.columnView.HorizontalOffset;
                localSettings.Values["nowReading"] = composite;
                //BookChapters.Chapters.Clear();
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Exemple #3
0
        /// <summary>
        /// Fired when the user presses the back button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PanelManager_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            // If if anyone else wants to handle this
            OnGoBackArgs args = new OnGoBackArgs();

            m_onGoBack.Raise(this, args);

            // If someone else already reacted don't do anything.
            if (args.IsHandled)
            {
                return;
            }

            // If we can go back mark it handled
            e.Handled = CanGoBack();

            if (e.Handled)
            {
                // Call go back but this might not work, we can't go back while something else is navigating.
                // If we can't go back right now just silently ignore the request.
                GoBack();
            }
            else
            {
                // If we can't go back anymore for the last back show the menu.
                // After that let the user leave.
                if (!m_finalNavigateHasShownMenu)
                {
                    m_finalNavigateHasShownMenu = true;
                    e.Handled = true;
                    ToggleMenu(true);
                }
            }
        }
Exemple #4
0
 private void NavigationService_BackEvent(object sender, Windows.UI.Core.BackRequestedEventArgs e)
 {
     if (!e.Handled)
     {
         e.Handled = true;
         Hide();
     }
 }
Exemple #5
0
 private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
 {
     if (NavigationService.CanGoBack)
     {
         NavigationService.GoBack();
         e.Handled = true;
     }
 }
Exemple #6
0
        private void PopupFrame_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            if (CanGoBack)
            {
                e.Handled = true;

                GoBack();
            }
        }
Exemple #7
0
 private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
 {
     // Navigate back if possible, and if the event has not
     // already been handled .
     if (frame.CanGoBack && e.Handled == false)
     {
         e.Handled = true;
         frame.GoBack();
     }
 }
Exemple #8
0
        private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame frame = Window.Current.Content as Frame;

            if (frame.CanGoBack)
            {
                frame.Navigate(typeof(GamePage));
                e.Handled = true; // указываем, что событие обработано
            }
        }
        private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame frame = Window.Current.Content as Frame;

            if (frame.CanGoBack)
            {
                frame.GoBack();
                e.Handled = true;
            }
        }
Exemple #10
0
        private void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Singleton tmp = Singleton.Instance;

            tmp.set_signal("modify_or_simple");
            Frame frame = Window.Current.Content as Frame;

            frame.Navigate(typeof(MainPage), "");
            Window.Current.Content = frame;
            Window.Current.Activate();
        }
Exemple #11
0
 private void OnBackRequested(object sender,
                              Windows.UI.Core.BackRequestedEventArgs e)
 {
     // Navigate back if possible, and if the event has not
     // already been handled .
     if (Window.Current.Content is Frame rootFrame && rootFrame.CanGoBack && e.Handled == false)
     {
         e.Handled = true;
         rootFrame.GoBack();
     }
 }
Exemple #12
0
 private void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
 {
     if (root_frame.CanGoBack)
     {
         e.Handled = true;
         root_frame.GoBack();
     }
     else
     {
         e.Handled = false;
     }
 }
        private void BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            if (!(Window.Current.Content is Frame rootFrame))
            {
                return;
            }

            if (rootFrame.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Exemple #14
0
        private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            ItemViewModel.NowPick = null;
            if (rootFrame == null)
            {
                return;
            }

            // Navigate back if possible, and if the event has not
            // already been handled .
            rootFrame.Navigate(typeof(MainPage), ItemViewModel);
        }
Exemple #15
0
        //--------------------------------------------------------Events:---------------------------------------------------------------------\\
        #region --Events--
        private void AbstractBackRequestPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }
            if (rootFrame.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Exemple #16
0
        private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame Rootframe = Window.Current.Content as Frame;

            if (Rootframe == null)
            {
                return;
            }
            if (Rootframe.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                Rootframe.GoBack(new DrillInNavigationTransitionInfo());
            }
        }
Exemple #17
0
        private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            if (rootFrame == null)
            {
                return;
            }

            // Navigate back if possible, and if the event has not already been handled .
            if (rootFrame.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Exemple #18
0
        private void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            MainPage.ViewModel1.SelectedItem = null;
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }
            if (rootFrame.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Exemple #19
0
        private void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            this.BackRequested?.Invoke(sender, e);

            if (!e.Handled)
            {
                if (rootFrame != null && rootFrame.CanGoBack)
                {
                    e.Handled = true;
                    rootFrame.GoBack();
                }
            }
        }
Exemple #20
0
        private void MenuBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            if (PageContent == null)
            {
                return;
            }

            // Navigate back if possible, and if the event has not
            // already been handled .
            if (PageContent.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                PageContent.GoBack();
            }
        }
Exemple #21
0
        //返回按钮事件
        private void AppViewBackRequestedButton(Object sender, Windows.UI.Core.BackRequestedEventArgs args)
        {
            if (InfoWebView.CanGoBack)
            {
                InfoWebView.GoBack();
            }
            else
            {
                WebView_Grid.Visibility = Visibility.Collapsed;
                Button_Grid.Visibility  = Visibility.Visible;

                HideBackRequestedButton();

                args.Handled = true;
            }
        }
        private async void MainPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            e.Handled = true;
            var msg      = new MessageDialog("Are you handsome?");
            var okBtn    = new UICommand("Yes");
            var kindaBtn = new UICommand("Kinda");

            msg.Commands.Add(okBtn);
            msg.Commands.Add(kindaBtn);
            IUICommand result = await msg.ShowAsync();

            if (result != null && result.Label.Equals("Yes"))
            {
                Application.Current.Exit();
            }
        }
Exemple #23
0
        private async void MainPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            e.Handled = true;
            var msg      = new MessageDialog("Would you like to exit?");// when the user hits the back button they'll be ask would they like to exit
            var okBtn    = new UICommand("Yes");
            var kindaBtn = new UICommand("No");

            msg.Commands.Add(okBtn);
            msg.Commands.Add(kindaBtn);
            IUICommand result = await msg.ShowAsync();

            if (result != null && result.Label.Equals("Yes"))
            {
                Application.Current.Exit();
            }
        }
Exemple #24
0
        private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }

            // Navigate back if possible, and if the event has not
            // already been handled .
            if (e.Handled == true)
            {
                MainWebView.Navigate(new Uri("ms-appx-web:///Assets/blank.html"));
            }
        }
Exemple #25
0
        /// <summary>
        /// Default Hardware/Shell Back handler overrides standard Back behavior that navigates to previous app
        /// in the app stack to instead cause a backward page navigation.
        /// Views or Viewodels can override this behavior by handling the BackRequested event and setting the
        /// Handled property of the BackRequestedEventArgs to true.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            if (BackRequested != null)
            {
                BackRequested(this, e);
            }

            if (!e.Handled)
            {
                if (RootFrame.CanGoBack)
                {
                    RootFrame.GoBack();
                    e.Handled = true;
                }
            }
        }
        private void AboutPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }
            if (rootFrame.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                FirstOpen = false;
                rootFrame.GoBack();
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
            }
        }
Exemple #27
0
        public static void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }

            // Navigate back if possible, and if the event has not
            // already been handled .
            if (rootFrame.CanGoBack && e.Handled == false)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Exemple #28
0
 private void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
 {
     // Fire the event - allows pages/Viewmodels to override/augment default back navigation behavior
     if (BackRequested != null)
     {
         BackRequested(this, e);
     }
     if (!e.Handled)
     {
         Frame frame = Window.Current.Content as Frame;
         if (frame.CanGoBack)
         {
             frame.GoBack();
             e.Handled = true;
         }
     }
 }
        private void App_BackRequested(object sender,
                                       Windows.UI.Core.BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }

            // Navigate back if possible, and if the event has not
            // already been handled .
            if (rootFrame.CanGoBack && e.Handled == false && Frame.SourcePageType == typeof(MasterDetailPage))
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Exemple #30
0
        private void NavigationFrame_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            e.Handled = true;

            // Close the App if you are on the startpage
            if (!this.CanGoBack)
            {
                Application.Current.Exit();
            }

            // Navigate back
            if (this.CanGoBack)
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            {
                this.GoBack(NavigationType.BackButton);
            }
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
        }