Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

How to invoke the Async method inside that same Async method at certain condition - Xamarin Forms

$
0
0

My code:

private async Task ExecuteSubmissionCommand()
{

    bool isImagesUploaded = UploadCapturedImages(dataAccess, AssessmentPageViewModel.maximumQueueId);
    if (!isImagesUploaded)
        {
            isSubmissionRetry = await Application.Current?.MainPage?.DisplayAlert("Error", "Problom while uploading captured images. Do you want to retry?", "Retry", "Cancel");
            if(isSubmissionRetry)
                {
                    await ExecuteSubmissionCommand();
                }
        }
}

When image upload process fails due to some network connection, then I will be showing alert to the user for "Retry" option.

If user clicks retry, then I should call the same method again to upload the failed images.

Any idea guys...?

Very urgent..

Thank you so much for your hearty reply in advance.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>