title: MVVM RelayCommand CanExecute
body: <p>I'm implementing an RelayCommand with an execute and an canExecute part. The RelayCommand works when it is without the canExecute part, however when I add the canExecute part, the command locks the button. The RelayCommand only checks whether or not the button can be executed as long as the CanExecute part is true. Once the canExecute part becomes false, the button can no longer be clicked, even if it is supposed to. How do I make sure that every time I click on the button it controls whether or not it can be executed, and doesn't lock it forever, once it cannot be executed?</p>
  
  <pre><code>RedoCommand = new RelayCommand(undoRedoController.Redo,undoRedoController.CanRedo);
  
     public bool CanRedo()
      {
          redoStack.Count();
          redoStack.Any();
          return redoStack.Any();
      }
  
      public void Redo()
      {
          if (redoStack.Count() &lt;= 0) throw new InvalidOperationException();
          IUndoRedoCommand command = redoStack.Pop();
          undoStack.Push(command);
          command.Execute();
      }
  
  
   public class UndoRedoController
  {
      private static UndoRedoController controller = new UndoRedoController();
  
      private readonly Stack&lt;IUndoRedoCommand&gt; undoStack = new Stack&lt;IUndoRedoCommand&gt;();
      private readonly Stack&lt;IUndoRedoCommand&gt; redoStack = new Stack&lt;IUndoRedoCommand&gt;();
  
      private UndoRedoController() { }
  
      public static UndoRedoController GetInstance() { return controller; }
  </code></pre>