コード例 #1
0
 public Task <bool> OnBackButtonPressedAsync()
 {
     // Always close the app on Back button press on this screen
     // (in Debug mode the user may have been routed to here from the passcode screen, but Back button should not navigate back to there)
     _closeApplication.CloseApp();
     return(Task.FromResult(false));
 }
コード例 #2
0
 /// <summary>
 /// Do check if permissions granted and request if not. Abort if User denies
 /// </summary>
 private void DoPermissionsCheck()
 {
     // This will abort the app at the start if the WIFI permissions are not given
     Xamarin.Forms.Device.BeginInvokeOnMainThread(async() => {
         if (!await this.CheckPermissions())
         {
             ICloseApplication closeApp = DependencyService.Get <ICloseApplication>();
             await Application.Current.MainPage.DisplayAlert(
                 App.GetText(MsgCode.Error),
                 "Insufficient permissions",
                 App.GetText(MsgCode.Ok));
             closeApp.CloseApp();
         }
     });
 }
コード例 #3
0
ファイル: PasscodeViewModel.cs プロジェクト: alexschott/mwf
        public async Task <bool> OnBackButtonPressedAsync()
        {
            var closeApp = true;

#if DEBUG
            closeApp = !await Mvx.Resolve <ICustomUserInteraction>().ConfirmAsync("DEBUGGING: Return to Customer Code screen?", cancelButton: "No, close the app");
#endif

            if (closeApp)
            {
                _closeApplication.CloseApp();
            }
            else
            {
                ShowViewModel <CustomerCodeViewModel>();
            }

            return(false);
        }
コード例 #4
0
ファイル: LoggingService.cs プロジェクト: alexschott/mwf
        private async Task LogAndCloseAsync(Exception ex)
        {
            await this.LogEventAsync(ex);

            _closeApplication.CloseApp();
        }