title: is asynchronous version of relaycommand required in order to run async methods correctly
body: <p>I have the following code defined in a viewmodel. I think that the SaveAsync of type <code>Func&lt;Task&gt;</code> is getting converted to Action since RelayCommand takes an Action not a <code>Func&lt;Task&gt;</code> but I'm not clear on the implications of that. </p>
  
  <p>1) Does RelayCommand need to be replaced with an asynchronous version (RelayCommandAsync)? 
  2) What exactly is the current code doing regarding asynchrony? 
  3) What if anything could/should I change to improve/correct it?</p>
  
  <pre><code>private ICommand _saveCommand;
  public ICommand SaveCommand
  {
      get { return _saveCommand ?? (_saveCommand = new RelayCommand(async () =&gt; await SaveAsync(), CanSave)); }
  }
  
  public bool CanSave()
  {
      return !IsBusy;
  }
  
  private async Task SaveAsync()
  {
      IsBusy = true;
  
      try
      {
          await _service.SaveAsync(SomeProperty); 
      }
      catch ( ServiceException ex )
      {
          Message = "Oops. " + ex.ToString();
      }
      finally
      {
          IsBusy = false;
      }
  }
  </code></pre>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT:</strong> After some experimenting it does appear that the async method itself works as it should. And it did not make a difference whether async/await was included in the lambda nor whether the method was defined as <code>async Task</code> or <code>async void</code>. </p>
  
  <p>However, what does not work correctly is the <code>canExecute</code> predicate functionality that automatically enables/disables the control binding to the command. What happens is that the button is correctly disabled while the async method runs but it is not enabled afterwards. I have to click somewhere on the window once and then it becomes enabled again. </p>
  
  <p>So it appears an async version of RelayCommand is required for full functionality, i.e. so <code>canExecute</code> can do its thing correctly.</p>