Jimmy
Jimmy

Reputation: 135

How to call an async Command from inside another async Command in Xamarin.Forms in MVVM?

Just as the title says, I'm trying to do this:

enter image description here

but I get this error.

Do you guys know what should I do ?

Thank you for your help

Upvotes: 0

Views: 127

Answers (1)

Himanshu Dwivedi
Himanshu Dwivedi

Reputation: 8124

You can write like this:

  Device.BeginInvokeOnMainThread(async() => {    
         Map.Pins.Clear();
         Map.MapElements.Clear();
         await ExecuteLoadPinsCommand();    
  });

Upvotes: 1

Related Questions