title: How to run ViewModel command after displayalert validation in Xamarin
body: <p>I have a delete object command working in my ViewModel. The command is bound to the button. So far, so good. When I click the button the object is deleted from the db. Now, obviously, this needs to be validated, so I am using DisplayAlert to show a "Are you sure you want to delete?" to the user. This displays, but the item deletes anyway on the button click which makes sense. I am struggling to understand how to only run my command in the ViewModel if the user chooses "Yes". </p>
  
  <p>XAML Button:</p>
  
  <pre><code> &lt;Button Text="Delete player" Command="{Binding DeleteCommand}" Clicked="DeletePlayerEvent"&gt;&lt;/Button&gt;
  </code></pre>
  
  <p>Clicked Event:</p>
  
  <pre><code> private async void DeletePlayerEvent(object sender, EventArgs e)
      {
          bool answer = await DisplayAlert("Notification", "Are you sure you want to delete this player?", "Yes", "No");
          //if (answer == true)??????
         // {
              //Can I run the command from here?
          //}
      }
  </code></pre>
  
  <p>ViewModel Command</p>
  
  <pre><code> public Command DeleteCommand
      {
          get
          {
              return new Command(async () =&gt;
              {
                  var playerServices = new PlayerServices();
                  await playerServices.DeletePlayerAsync(_Player.Id);
              });
          }
      }
  </code></pre>