private void OnBackRequested(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(); } }
private void CreateTweetPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = true; if (DateTime.Now - TmpUserData.PreviousBackRequest < new TimeSpan(0, 0, 1)) { return; } else { TmpUserData.PreviousBackRequest = DateTime.Now; } if (Frame.CanGoBack) { Frame.GoBack(); } }
private async void EasyMode_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = true; disTimer.Stop(); disTimer = null; var msg = new MessageDialog("App will be closed do you wish to continue?"); var yes = new UICommand("Yes"); var no = new UICommand("No"); msg.Commands.Add(yes); msg.Commands.Add(no); IUICommand result = await msg.ShowAsync(); if (result != null && result.Label.Equals("Yes")) { Frame.Navigate(typeof(GameOver), Score.ToString()); }//if }
#pragma warning disable CC0057 // Unused parameters #pragma warning disable IDE0060 // Remove unused parameter public static void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) #pragma warning restore IDE0060 // Remove unused parameter #pragma warning restore CC0057 // Unused parameters { var popupNavigationInstance = Rg.Plugins.Popup.Services.PopupNavigation.Instance; //e.Handled = false; if (popupNavigationInstance.PopupStack.Count > 0) { var lastPage = popupNavigationInstance.PopupStack.Last(); var isPreventClose = // lastPage.IsBeingDismissed || lastPage.SendBackButtonPressed(); if (!isPreventClose) { Xamarin.Forms.Device.BeginInvokeOnMainThread(async() => { await popupNavigationInstance.PopAsync(); }); } e.Handled = true; /* * //Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; * var b = Windows.UI.Core.SystemNavigationManager.GetForCurrentView(); * var fields = typeof(Windows.UI.Core.SystemNavigationManager).GetFields(); * var events = typeof(Windows.UI.Core.SystemNavigationManager).GetRuntimeEvents(); * //EventInfo f1 = typeof(Windows.UI.Core.SystemNavigationManager).GetEvent("BackRequested", BindingFlags.Static | BindingFlags.NonPublic); * EventInfo f1 = null; * foreach (var evnt in events) * if (evnt.Name == "BackRequested") * f1 = evnt; * var remove = f1.GetRemoveMethod(); * var methods = f1.GetOtherMethods(); * * //foreach (var method in methods) * // f1.RemoveEventHandler(b, method); */ } }
private async void PlaySingle_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = true; dispatcherTimer.Stop(); dispatcherTimer = null; 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(); Frame.Navigate(typeof(GameOver), Score.ToString()); // Navigate to game over screen and send score } }
private void MainPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { if (frameEventList.CanGoBack && frameEventDetails.IsEnabled == false) { frameEventList.GoBack(); e.Handled = true; } else if (frameEventDetails.IsEnabled == true && frameEventDetails.Visibility == Visibility.Visible) { frameEventDetails.Content = null; frameEventDetails.Visibility = Visibility.Collapsed; frameEventDetails.IsEnabled = false; } if (!frameEventList.CanGoBack && frameEventDetails.IsEnabled == false) { Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Collapsed; } }
/// <summary> /// Handles the back button press and navigates through the history of the root frame. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">Details about the back button press.</param> private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { Frame frame = Window.Current.Content as Frame; if (frame == null) { return; } var handler = this.BackPressed; if (handler != null) { handler(sender, e); } if (frame.CanGoBack && !e.Handled) { frame.GoBack(); e.Handled = true; } }
private void PC_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { FirstPage.firstpage.Second_Page_Back(); Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Collapsed; }
private void ShellPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { }
private void BackupProgress_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = true; }
private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = On_BackRequested(); }
private void BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) => Frame.GoBack();
private void View_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { //if (contentFrame.CanGoBack) }
private void BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { view.rssVisibility = Visibility.Collapsed; }
private void PersonPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { this.Frame.Navigate(typeof(MainPage)); }
private void OnBackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = true; this.Hide(); }
private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { throw new NotImplementedException(); }
private void BlockBack(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = true; }
private void MainPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { e.Handled = true; AppCore.ModerateBack(); }