Exemple #1
0
 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
     {
     }
 }
Exemple #2
0
 private void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
 {
     e.Handled = true;
     if (Fr.CanGoBack)
     {
         Fr.GoBack();
     }
     else
     {
         App.Current.Exit();
     }
 }
Exemple #3
0
 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();
     }
 }
Exemple #4
0
 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
     {
     }
 }