public MainPage() { InitializeComponent(); SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested; if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) { Windows.Phone.UI.Input.HardwareButtons.BackPressed += (s, e) => { if (ScenarioFrame.CanGoBack) { e.Handled = true; ScenarioFrame.GoBack(); } }; } if (ApiInformation.IsTypePresent(typeof(StatusBar).ToString())) { StatusBar statusBar = StatusBar.GetForCurrentView(); statusBar.HideAsync(); } ToastShow.currentMainPage = this; isLoading.PropertyChanged += IsLoading_PropertyChanged; Loaded += MainPage_Loaded; }
private void Back_Click(object sender, RoutedEventArgs e) { if (ScenarioFrame.CanGoBack) { ScenarioFrame.GoBack(); } }
void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e) { if (ScenarioFrame.CanGoBack) { ScenarioFrame.GoBack(); e.Handled = true; } }
private void SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e) { if (ScenarioFrame.CanGoBack) { e.Handled = true; ScenarioFrame.GoBack(); } }
private void backButton_Click(object sender, RoutedEventArgs e) { if (ScenarioFrame.CanGoBack) { ScenarioFrame.GoBack(); } checkAdditionButtons(); }
/// <summary> /// The hardware buttons back pressed. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="eventArgs"> /// The event args. /// </param> private void HardwareButtonsBackPressed(object sender, BackPressedEventArgs eventArgs) { if (ScenarioFrame.CanGoBack) { ScenarioFrame.GoBack(); // Indicate the back button press is handled so the app does not exit eventArgs.Handled = true; } }
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; } }