title: How can I call an async command with a view model?
body: <p>I have this code and I am wanting to move it into a view model:</p>
  
  <pre class="lang-cs prettyprint-override"><code>resetButton.Clicked += async (sender, e) =&gt;
  {
     if (App.totalPhrasePoints &lt; 100 || await App.phrasesPage.DisplayAlert(
                  "Reset score",
                  "You have " + App.totalPhrasePoints.ToString() + " points. Reset to 0 ? ", "Yes", "No"))
        App.DB.ResetPointsForSelectedPhrase(App.cfs);
  };
  </code></pre>
  
  <p>I realize I will need to set up something like this:</p>
  
  <p>In my XAML code;</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Button x:Name="resetButton" Text="Reset All Points to Zero" Command="{Binding ResetButtonClickedCommand}"/&gt;
  </code></pre>
  
  <p>And in my C# code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private ICommand resetButtonClickedCommand;
  
  public ICommand ResetButtonClickedCommand
  {
     get
     {
        return resetButtonClickedCommand ??
        (resetButtonClickedCommand = new Command(() =&gt;
        {
  
        }));
  
      }
  </code></pre>
  
  <p>But how can I fit the async action into a command?</p>