Esempio n. 1
0
        public void Print(string html, string jobName)
        {
            _activityIndicatorPopup = ActivityIndicatorPopup.Create();
            var taskCompletionSource = new TaskCompletionSource <ToFileResult>();

            InnerPrint(taskCompletionSource, html, jobName);
        }
Esempio n. 2
0
        public Task PrintAsync(string html, string jobName, FailAction failAction = FailAction.ShowAlert)
        {
            _activityIndicatorPopup = ActivityIndicatorPopup.Create();
            var taskCompletionSource = new TaskCompletionSource <ToFileResult>();

            InnerPrint(taskCompletionSource, html, jobName, failAction);
            return(taskCompletionSource.Task);
        }
Esempio n. 3
0
 private void SetupUI()
 {
     ToolbarItems.Add(new ToolbarItem("Export PDF", "ic_save", async() => {
         if (BindingContext is ReportDetailPageViewModel viewModel)
         {
             var popup = new ActivityIndicatorPopup();
             await PopupNavigation.Instance.PushAsync(popup);
             await viewModel.ExportPDF();
             await PopupNavigation.Instance.RemovePageAsync(popup);
         }
     }));
Esempio n. 4
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();
            if (BindingContext is DashboardPageViewModel viewModel)
            {
                var loadingPopup = new ActivityIndicatorPopup();
                await PopupNavigation.Instance.PushAsync(loadingPopup);

                await viewModel.Update();

                await PopupNavigation.Instance.RemovePageAsync(loadingPopup);
            }
        }
Esempio n. 5
0
        async void Handle_Clicked(object sender, EventArgs e)
        {
            if (App.Authenticator != null)
            {
                if (sender is Button loginButton)
                {
                    loginButton.IsEnabled = false;
                }
                var authenticated = await App.Authenticator.Authenticate();

                var error = true;
                if (authenticated == true)
                {
                    error = false;
                    var user = LoginManager.Instance.MobileClient.CurrentUser;

                    var loadingPopup = new ActivityIndicatorPopup();
                    await PopupNavigation.Instance.PushAsync(loadingPopup);

                    error = !(await LoginManager.Instance.RetrieveUserData());
                    await PopupNavigation.Instance.RemovePageAsync(loadingPopup);


                    if (sender is Button button)
                    {
                        button.IsEnabled = true;
                    }
                }

                if (error)
                {
                    await DisplayAlert("Error", "Something went wrong while trying to login with your account. Please try again.", "Ok");
                }
                else
                {
                    Application.Current.MainPage = new MainMasterDetailPage();
                }
            }
        }