예제 #1
0
        public void HideLoading()
        {
            ThreadingHelpers.InvokeOnMainThread(async() =>
            {
                int retry = 0;

                if (_spinnerPageInstance == null)
                {
                    return;
                }

                while (!_isSpinning && retry <= 5)
                {
                    await Task.Delay(200);
                    retry++;
                }

                if (_spinnerPageInstance != null)
                {
                    await _navigationService.Navigation.RemovePopupPageAsync(_spinnerPageInstance, true);
                    //await _navigationService.Navigation.PopPopupAsyncSafe(_popupNavigation, true);
                }

                _spinnerPageInstance = null;
                _isSpinning          = false;
            });
        }
예제 #2
0
        public void ShowLoading(bool isCancellable = true)
        {
            ThreadingHelpers.InvokeOnMainThread(async() =>
            {
                if (_spinnerPageInstance == null)
                {
                    _spinnerPageInstance = new ProgressSpinnerPage(isCancellable);

                    await _navigationService.Navigation.PushPopupAsyncSafe(_spinnerPageInstance, _popupNavigation, true)
                    .ContinueWith((t) => _isSpinning = true);
                }
            });
        }