title: Xamarin MVVM double click executes command twice and IsBusy doesnt work
body: <p>So I have a button which is bound to a Login command</p>
  
  <pre><code>    private ICommand loginCommand;
      public ICommand LoginCommand
      {
          get
          {
              if (loginCommand == null)
              {
                  loginCommand = new Command(login, CanExecuteCommand);
              }
              return loginCommand;
          }
      }
  </code></pre>
  
  <p>The <code>CanExecuteCommand</code> action returns <code>!IsBusy</code></p>
  
  <p>In the login() action I start with <code>IsBusy = true</code> and end with <code>IsBusy = false;</code>
  In the setter of <code>IsBusy</code> I also call the <code>ChangeCanExecute()</code> method like this:</p>
  
  <p><code>((Command)comm).ChangeCanExecute();</code></p>
  
  <p>When I am debugging <code>ChangeCanExecute</code> is really called on the command instance at the start and end of the method. However, if I double click the button, it still calls the command twice. Why is that? What's the cleanest way to disable double clicks using MVVM... By the way, on another VM I use the same approach and it works totally fine but there in the executed command I call an async method so I use <code>await</code>. Maybe that's why it works there? In the <code>login</code> case I call a <code>void</code> method in the command so if I double click the button the calls simply get queued? I still don't understand why <code>ChangeCanExecute+IsBusy</code> is not enough.</p>
  
  <p>P.S.
  While my commands are defined in the VM, <code>IsBusy, CanExecuteCommand</code> and the raising of the <code>ChangeCanExecute</code> event happen in the <code>BaseViewModel</code>.</p>
  
  <p>Edit 1:
  In <code>login()</code> I have code like this:
  <code>{ IsBusy = true; DoSomething(); IsBusy = false;}</code> This has the unexpected functionality I explained and it gets called twice. However, if I change this to be in a Task like I have it in my working VM, double tap is not possible, any clues?
  <code>
  IsBusy = true;
  Task.Run(() =&gt;
  {
      DoSomething();
  }).SafeFireAndForget();
  IsBusy = false;
  </code></p>
  
  <p>I looked through answers regarding this and they don't seem to use the MVVM approach and they offer solutions using <code>TapGestureRecognizer</code> / some other things which don't seem like a best MVVM practice.</p>