Пример #1
0
 private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     /*
      * System.Windows.Controls.Frame rootFrame = this.Content as Frame;
      * if (rootFrame != null && rootFrame.CanGoBack && MainWebView.CanGoBack)
      * {
      *      e.Handled = true;
      *      MainWebView.GoBack();
      * }
      */
     return;
 }
Пример #2
0
 void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (DrawerLayout.IsDrawerOpen)
     {
         DrawerLayout.CloseDrawer();
         e.Handled = true;
     }
     else
     {
         Application.Current.Exit();
     }
 }
 void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (IsOpen)
     {
         CloseDialog();
     }
     else
     {
         ConfirmAndExit();
     }
     e.Handled = true;
 }
Пример #4
0
        public void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame != null)
            {
                if (rootFrame.CanGoBack)
                {
                    e.Handled = true;
                    rootFrame.GoBack();
                }
            }
        }
Пример #5
0
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame != null)
            {
                if (rootFrame.CanGoBack)
                {
                    rootFrame.GoBack();
                    e.Handled = true;
                }
            }
        }
Пример #6
0
 private static void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (CanNavigateBack)
     {
         NavigateBack();
         e.Handled = true;
     }
     else
     {
         bool allowExit = (_currentPage as IManageable).AllowAppExit();
         e.Handled = !allowExit;
     }
 }
Пример #7
0
        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            if (ScenarioFrame.CanGoBack)
            {
                // Clear the status block when navigating
                NotifyUser(String.Empty, NotifyType.StatusMessage);

                ScenarioFrame.GoBack();

                //Indicate the back button press is handled so the app does not exit
                e.Handled = true;
            }
        }
Пример #8
0
 /// <summary>
 /// Manage backButton pressed: close appsettings panel if open, and exit app if on main page
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (this.SettingsPopup.IsOpen)
     {
         this.SettingsPopup.IsOpen = false;
         e.Handled = true;
     }
     else
     {
         StopSensors();
         Application.Current.Exit();
     }
 }
 private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (!e.Handled && Frame.CanGoBack)
     {
         Frame.GoBack();
         //Indicate the back button press is handled so the app does not exit
         e.Handled = true;
     }
     else
     {
         App.Current.Exit();
     }
 }
Пример #10
0
 private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     e.Handled = true;
     if (picDetail.Visibility == Visibility.Visible)
     {
         picDetail.Visibility = Visibility.Collapsed;
         picList.Visibility   = Visibility.Visible;
     }
     else
     {
         MainPage._CurrentHandle.GoBack(true);
     }
 }
Пример #11
0
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame frame = Window.Current.Content as Frame;

            if (frame == null)
            {
                return;
            }
            if (frame.CanGoBack)
            {
                frame.Navigate(typeof(MainPage), "");
                e.Handled = true;
            }
        }
Пример #12
0
        private async void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            await _bandClient.SensorManager.Pedometer.StopReadingsAsync();

            _bandClient.SensorManager.Pedometer.ReadingChanged -= PedometerOnReadingChanged;
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame != null && rootFrame.CanGoBack)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
            gg.Value = 0;
        }
Пример #13
0
        private async void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame != null && rootFrame.CanGoBack)
            {
                // Do something with the back button here
                var dlg = new Windows.UI.Popups.MessageDialog("You tapped the Back button!!!.");
                await dlg.ShowAsync();

                rootFrame.GoBack();
                e.Handled = true;
            }
        }
Пример #14
0
 private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (SearchBox.Visibility == Visibility.Visible)
     {
         SearchBox.Visibility = Visibility.Collapsed;
         SearchBox.Text       = "";
         ((ItemsShowcaseViewModel)DataContext).ClearSearch.Execute(null);
         e.Handled = true;
     }
     else
     {
         Application.Current.Exit();
     }
 }
Пример #15
0
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame != null && rootFrame.CanGoBack && rootFrame.CurrentSourcePageType != typeof(Tickets.MainPage))
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
            else
            {
                e.Handled = false;
            }
        }
Пример #16
0
        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                return;
            }
            if (!rootFrame.CanGoBack)
            {
                return;
            }
            rootFrame.GoBack(); e.Handled = true;
        }
Пример #17
0
        /// <summary>
        /// Invoked when the hardware back button is pressed. For Windows Phone only.
        /// </summary>
        /// <param name="sender">Instance that triggered the event.</param>
        /// <param name="e">Event data describing the conditions that led to the event.</param>
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame.SourcePageType != typeof(CommanderPage) && this.GoBackCommand.CanExecute(null))
            {
                e.Handled = true;
                this.GoBackCommand.Execute(null);
            }
            else
            {
                Application.Current.Exit();
            }
        }
Пример #18
0
        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame != null && rootFrame.CanGoBack)
            {
                rootFrame.GoBack();
                e.Handled = true;
            }
            //var frame = new Frame();
            //frame.Navigate(typeof(PubnubDemoStart));
            //Window.Current.Content = frame;
            //e.Handled = true;
        }
Пример #19
0
        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            try
            {
                new HostName(TB_IP.Text);
            }
            catch
            {
                return;
            }
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            localSettings.Values["IP"] = TB_IP.Text;
        }
Пример #20
0
 private void BackButtonPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     e.Handled = true;
     if (NowPlayingFrame.BackStackDepth <= 1)
     {
         NowPlayingFrame.BackStack.Clear();
         Windows.Phone.UI.Input.HardwareButtons.BackPressed -= BackButtonPressed;
         NavigationService.Instance.RegisterEvents();
         _shellVm.IsPlaybarHidden = false;
     }
     else
     {
         NowPlayingFrame.GoBack(new Windows.UI.Xaml.Media.Animation.SlideNavigationTransitionInfo());
     }
 }
Пример #21
0
        private void FeedbackOverlay_BackKeyPress(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
#endif
        {
            // If back is pressed whilst notification is open, close
            // the notification and cancel back to stop app from exiting.
            if (Visibility == Visibility.Visible)
            {
                OnNoClick();
#if SILVERLIGHT
                e.Cancel = true;
#else
                e.Handled = true;
#endif
            }
        }
Пример #22
0
        public void OnBackKeyPress(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            if (HasPopup)
            {
                e.Handled = true;
                return;
            }

            if (IsOpen)
            {
                e.Handled         = true;
                BackButtonPressed = true;
                Hide();
            }
        }
Пример #23
0
        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame frame = Window.Current.Content as Frame;

            if (frame == null)
            {
                return;
            }

            if (frame.CanGoBack)
            {
                frame.GoBack();
                //Indicate the back button press is handled so the app does not exit
                e.Handled = true;
            }
        }
Пример #24
0
        /// <summary>
        /// Invoked when the hardware back button is pressed. For Windows Phone only.
        /// </summary>
        /// <param name="sender">Instance that triggered the event.</param>
        /// <param name="e">Event data describing the conditions that led to the event.</param>
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (this.Page is HomePage)
            {
            }
            else
            {
                if (rootFrame != null && rootFrame.CanGoBack)
                {
                    e.Handled = true;
                    rootFrame.GoBack();
                }
            }
        }
Пример #25
0
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            int BackStackDepth = Frame_Main.BackStackDepth;

            if (BackStackDepth == 1)
            {
                //어플종료코드 넣어야함
                Frame_Main.GoBack();
                e.Handled = true;
            }
            else if (Frame_Main.CanGoBack)
            {
                Frame_Main.GoBack();
                e.Handled = true;
            }
        }
Пример #26
0
 private void HardwareButtonBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (ArticleContorl.BackBtnVisibility == Visibility.Visible)
     {
         e.Handled = true;
         if (ArticleContorl.CommentOpened)
         {
             ArticleContorl.CloseCommentPanel();
         }
         else
         {
             BackButtonClick(null, null);
             ArticleContorl.BackBtnVisibility = Visibility.Collapsed;
         }
     }
 }
Пример #27
0
 /// <summary>
 /// Invoked when the hardware back button is pressed. For Windows Phone only.
 /// </summary>
 /// <param name="sender">Instance that triggered the event.</param>
 /// <param name="e">Event data describing the conditions that led to the event.</param>
 private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (this.GoBackCommand.CanExecute(null))
     {
         e.Handled = true;
         if (BlockBackStateTemporarily != null)
         {
             BlockBackStateTemporarily();
             BlockBackStateTemporarily = null;
         }
         else
         {
             this.GoBackCommand.Execute(null);
         }
     }
 }
 private static async void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (CanNavigateBack)
     {
         NavigateBack();
         e.Handled = true;
     }
     else
     {
         if (_currentPage as IAppReturnControllable != null)
         {
             bool allowExit = await(_currentPage as IAppReturnControllable).AllowAppExit();
             e.Handled = !allowExit;
         }
     }
 }
Пример #29
0
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            e.Handled = true;

            Frame frame = Window.Current.Content as Frame;

            if (frame == null)
            {
                return;
            }

            if (frame.CanGoBack)
            {
                frame.GoBack();
            }
        }
Пример #30
0
 private void Hardwarebuttons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (this.Frame == null)
     {
         return;
     }
     if (this.Frame.CanGoBack)
     {
         this.Frame.GoBack();
         e.Handled = true;
     }
     else
     {
         this.Frame.Navigate(typeof(MainPage), "");
         e.Handled = true;
     }
 }