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

Starting and cancelling an asynchronous task

$
0
0

I have a XAML-based Xamarin.Forms page with some buttons bound to commands (implementations of the “System.Windows.Input.ICommand” interface) defined as properties of my ViewModel, which is in the BindingContext of the page. I need to be able to use one button to invoke a method of the ViewModel calling an async method (with “await”) from a referenced library (I cannot modify this method) and to use another button to cancel the async method from the referenced library if its execution lasts too long. What is the best way to achieve this?


Viewing all articles
Browse latest Browse all 75885

Trending Articles



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