Share via

Loading dosent appear, when loading a Note

Eduardo Gomez 4,316 Reputation points
2022-03-20T21:21:16.667+00:00

When I connect to Azure and retrive a Note, I am showing a loading popup while waiting, but the thing is that the loading pop up never appears, even though I use in other places

public async Task<string> GetBlobStorage(string FileName) {

        UserDialogs.Instance.ShowLoading(AppResources.Loading);
        var blob = BlobContainerClient.GetBlobClient(FileName);
        BlobDownloadInfo download = blob.Download();
        var content = download.Content;
        string text = string.Empty;
        using (var streamReader = new StreamReader(content)) {
            while (!streamReader.EndOfStream) {
                text = await streamReader.ReadLineAsync();
            }
        }

        UserDialogs.Instance.HideLoading();

        return text;
    }

https://github.com/eduardoagr/DuoNotes

Developer technologies | .NET | Xamarin
0 comments No comments

Answer accepted by question author

Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,166 Reputation points Microsoft External Staff
2022-03-21T05:27:45.307+00:00

Hello,

You need to modify the function GetBlobStorage(string FileName) in your AzureService.cs to the following style:

   public async Task<string> GetBlobStorage(string FileName) {  
   	string text = string.Empty;  
   	using (UserDialogs.Instance.Loading(AppResources.Loading))  
   	{  
   		await Task.Delay(1);  
   		// your logic code  
   	}  
   	return text;  
   }  

Then, the Loading Dialog will appear.

Best Regards,

Alec Liu.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.