title: The name "CommandManager" does not exist in the current context (Visual Studio 2015)
body: <p>Trying to use the RelayCommand class below I received the error message: "The name "CommandManager" does not exist in the current context". According to this post <a href="https://stackoverflow.com/questions/16950813/class-library-does-not-recognize-commandmanager-class">Class library does not recognize CommandManager class</a> I tried to solve the problem by adding an assembly called PresentationCore on "Add Reference". Unfortunately "No framework assemblies were found on the machine".
  I uninstalled Microsoft.NETCore.UniversalWindowsPlatform and reinstalled it as recommended in some posts and I repaired Visual Studio, but this doesn't change anything. Is this my failure or is it a bug? As a newbie I always tend to think I overlooked something;-)</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Input;
  
  namespace MyApplication.Viewmodels
  {
  public class RelayCommand : ICommand
  {
      private readonly Action&lt;object&gt; _Execute;
      private readonly Func&lt;object, bool&gt; _CanExecute;
  
      public RelayCommand(Action&lt;object&gt; execute)
          : this(execute, null)
      {
  
      }
  
      public RelayCommand(Action&lt;object&gt; execute, Func&lt;object, bool&gt; canExecute)
      {
          if (execute == null)
          {
              throw new ArgumentNullException("execute", "Execute cannot be null.");
          }
  
          _Execute = execute;
          _CanExecute = canExecute;
      }
  
      public event EventHandler CanExecuteChanged
      {
          add { CommandManager.RequerySuggested += value; }
          remove { CommandManager.RequerySuggested -= value; }
      }
  
      public void Execute(object parameter)
      {
          _Execute(parameter);
      }
  
      public bool CanExecute(object parameter)
      {
          if (_CanExecute == null)
          {
              return true;
          }
  
          return _CanExecute(parameter);
      }
  }
  }
  </code></pre>