コード例 #1
0
        private async void ShowLoadingButton_OnClicked(object sender, EventArgs e)
        {
            _loadingService.ShowLoading();
            await Task.Delay(2000);

            _loadingService.HideLoading();
        }
コード例 #2
0
        private async void LoginCommandExecute()
        {
            _loadingService.ShowLoading();

            // Input fields validation
            if (!AreFieldsValid())
            {
                return;
            }

            string authResult = AuthenticationManager.Authenticate(UserName, Password);

            if (authResult == ConstantsHelper.UserNotExistsMessage)
            {
                var userNotExistsMessageLocalized = Resmgr.Value.GetString(ConstantsHelper.UserNotExistsMessage, _cultureInfo);
                _alertService.ShowOkAlert(userNotExistsMessageLocalized, ConstantsHelper.Ok);
                _loadingService.HideLoading();
                return;
            }
            if (authResult == ConstantsHelper.IncorrectPassword)
            {
                var incorrectPasswordMessageLocalized = Resmgr.Value.GetString(ConstantsHelper.IncorrectPassword, _cultureInfo);
                _alertService.ShowOkAlert(incorrectPasswordMessageLocalized, ConstantsHelper.Ok);
                _loadingService.HideLoading();
                return;
            }
            _loadingService.HideLoading();
            Settings.CurrentUserId       = authResult;
            Application.Current.MainPage = new NavigationPage(new NotesPage());
        }