title: ICommand CanExecute not triggering after PropertyChanged?
body: <p>I got a <strong>WPF application</strong> that shows a button bound to a command like that:</p>
  
  <pre><code>&lt;Button Command="{Binding Path=TestrunStartCommand}" Content="GO!"&gt;
  </code></pre>
  
  <p>The command is defined like that:</p>
  
  <pre><code>public ICommand TestrunStartCommand
  {
      get { return new RelayCommand(TestrunStartExecute, () =&gt; !IsTestrunInProgress); }
  }
  
  public bool IsTestrunInProgress
  {
      get{
          return _isTestrunInProgress;
      }
      set{
          _isTestrunInProgress = value;
          RaisePropertyChanged(IsTestrunInProgressPropertyName);
      }
  }   
  </code></pre>
  
  <p>The problem is, the button won't be enabled immediately after I set <code>IsTestrunInProgress</code> to false, but <em>only after I click inside the application window</em>.</p>
  
  <p>Could you help me understand this behaviour and show me how to fix this?</p>
  
  <p><strong>Further reading:</strong>
  <a href="https://robburke.net/wpf-command-pattern-when-does-it-query-canexecute/" rel="noreferrer">wpf command pattern - when does it query canexecute</a></p>