コード例 #1
0
        private async void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            e.Handled = true;

            HardwareButtons.BackPressed -= OnBackPressed;
            Frame.Navigate(typeof(ChooseMode));
        }
コード例 #2
0
 private async void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     e.Handled = true;
     // add your own code here to run when Back is pressed
     HardwareButtons.BackPressed -= OnBackPressed;
     Frame.Navigate(typeof(MainMenu));
 }
コード例 #3
0
 private void BackButtonPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     e.Handled = true;
     Windows.Phone.UI.Input.HardwareButtons.BackPressed -= BackButtonPressed;
     NavigationService.Instance.RegisterEvents();
     IsPlaybarHidden = false;
 }
コード例 #4
0
ファイル: signUp.xaml.cs プロジェクト: ygoddard/guitar
 void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (Frame.CanGoBack)
     {
         e.Handled = true;
         Frame.GoBack();
     }
 }
コード例 #5
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 (NavigationService.CanGoBack())
     {
         e.Handled = true;
         NavigationService.GoBack();
     }
 }
コード例 #6
0
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            //closeApp = true;
            //e.Handled = true;

            // test
            //mDialog("Wollen Sie die Evaluation beenden?");
        }
コード例 #7
0
        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame != null && rootFrame.CanGoBack)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
        private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            DispatcherTimerOff();
            //removeEffects();
            disposeCamera();

            Application.Current.Exit();
            //closeApp = true;
            e.Handled = true;
            //mDialog("Wollen Sie die Evaluation beenden?", 0);
        }
コード例 #9
0
        private void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            var frame = Window.Current.Content as Frame;

            if (frame == null || !frame.CanGoBack)
            {
                return;
            }
            e.Handled = true;
            frame.GoBack();
        }
コード例 #10
0
 private async void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     e.Handled = true;
     // add your own code here to run when Back is pressed
     if (SharedInformation.sharedMode == "quizz")
     {
         HardwareButtons.BackPressed -= OnBackPressed;
         Frame.Navigate(typeof(ChooseQuizz));
     }
     else
     {
         HardwareButtons.BackPressed -= OnBackPressed;
         Frame.Navigate(typeof(AdventureMap));
     }
 }
コード例 #11
0
        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            var 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;
            }
        }
コード例 #12
0
ファイル: About4.xaml.cs プロジェクト: shyamshr93/SocializeUp
 private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     lvSettingsCategory.SelectedIndex = -1;
     if (vsgMain.CurrentState.Name == vsMobile.Name && !gdColumn0.Width.IsStar)
     {
         gdColumn0.Width = new GridLength(1, GridUnitType.Star);
         gdColumn1.Width = new GridLength(0, GridUnitType.Pixel);
     }
     else
     {
         if (this.Frame.CanGoBack)
         {
             Frame.GoBack();
         }
     }
     e.Handled = true;
 }
コード例 #13
0
        private async void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            e.Handled = true;
            if (rootFrame.CanGoBack)
            {
                rootFrame.GoBack();
            }
            else
            {
                var msg       = new MessageDialog("Are you sure to exit?");
                var okBtn     = new UICommand("Yes");
                var cancelBtn = new UICommand("No");
                msg.Commands.Add(okBtn);
                msg.Commands.Add(cancelBtn);
                IUICommand result = await msg.ShowAsync();

                if (result != null && result.Label == "Yes")
                {
                    Application.Current.Exit();
                }
            }
        }
コード例 #14
0
 private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
        //protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        //{
        //    MessageBoxResult result = MessageBox.Show("Deseja realmente sair?", "Atenção!", MessageBoxButton.OKCancel); //Exibe um MessageBox com uma mensagem e duas opções ("ok" e "Cancel")

        //    if (result == MessageBoxResult.OK) //se o usuário tocar "OK"
        //    {
        //        NavigationService.Navigate(new Uri("Home.xaml", UriKind.Relative));
        //        base.OnBackKeyPress(e); //voltar página
        //    }

        //    else
        //    {

        //        e.Cancel = true; //Senão, cancelar ação (nada acontece)

        //    }

        //}


        void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
        {
            e.Handled = true;
            Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
            NavigationService.Navigate(new Uri("Home.xaml", UriKind.Relative));
        }