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?
↧