Created
October 13, 2021 13:47
-
-
Save aritchie/58dc3b021756ab7de3e49ead21fa451f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async void Button_Clicked_3(System.Object sender, EventArgs args) { | |
var cts = new CancellationTokenSource(); | |
try | |
{ | |
// if any exception is thrown, the progress will be cleaned up automagically | |
using (var disp = UserDialogs.Instance.Loading( | |
"Long Load...", | |
// this will cancel the actual http call | |
() => cts.Cancel(), | |
"Cancel")) | |
{ | |
var data = await httpLong.GetData(cts.Cancel); | |
} | |
} | |
catch (Exception ex) { | |
UserDialogs.Instance.Alert(ex.ToString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment