private void MainPage_BackRequested(object sender, BackRequestedEventArgs e) { e.Handled = true; try { if (Fr.CanGoBack) { Fr.GoBack(); } else { RavinduL.LocalNotifications.LocalNotificationManager lnm = new RavinduL.LocalNotifications.LocalNotificationManager(MG); lnm.Show(new SimpleNotification { TimeSpan = TimeSpan.FromSeconds(5), Text = "Click/Tap Here to exit", Glyph = "\uE7E8", Background = (new SolidColorBrush((Color)Resources["SystemControlBackgroundAccentBrush"])), VerticalAlignment = VerticalAlignment.Bottom, Action = () => { App.Current.Exit(); }, }, RavinduL.LocalNotifications.LocalNotificationCollisionBehaviour.Wait); //var msg = new MessageDialog(MultilingualHelpToolkit.GetString("stringExit", "Text")); //msg.Commands.Add(new UICommand(MultilingualHelpToolkit.GetString("StringYes", "Text"), delegate //{ // App.Current.Exit(); //})); //msg.Commands.Add(new UICommand(MultilingualHelpToolkit.GetString("StringNo", "Text"), delegate { })); //await msg.ShowAsync(); } } catch { } }
private void MainPage_BackRequested(object sender, BackRequestedEventArgs e) { e.Handled = true; if (Fr.CanGoBack) { Fr.GoBack(); } else { App.Current.Exit(); } }
private async void MainPage_BackRequested(object sender, BackRequestedEventArgs e) { e.Handled = true; if (Fr.CanGoBack) { Fr.GoBack(); } else { var msg = new MessageDialog("Are you sure you want to exit?"); msg.Commands.Add(new UICommand("Yes", delegate { App.Current.Exit(); })); msg.Commands.Add(new UICommand("No", delegate { })); await msg.ShowAsync(); } }
private async void MainPage_BackRequested(object sender, BackRequestedEventArgs e) { e.Handled = true; try { if (Fr.CanGoBack) { Fr.GoBack(); } else { var msg = new MessageDialog(MultilingualHelpToolkit.GetString("stringExit", "Text")); msg.Commands.Add(new UICommand(MultilingualHelpToolkit.GetString("StringYes", "Text"), delegate { App.Current.Exit(); })); msg.Commands.Add(new UICommand(MultilingualHelpToolkit.GetString("StringNo", "Text"), delegate { })); await msg.ShowAsync(); } } catch { } }