title: WPF Commanding problem
body: <p>Why commanded control is always disabled however command can be executed? Command also runs with <code>Alt + F4</code></p>
  
  <pre><code>public static class CommandLibrary {
      static CommandLibrary() {
          ShutDownCommand = new RoutedUICommand("Exit", "Exit", typeof(CommandLibrary), new InputGestureCollection {new KeyGesture(Key.F4, ModifierKeys.Alt)});
      }
  
      public static RoutedUICommand ShutDownCommand { get; private set; }
  
      public static void BindCommands(Window hostWindow) {
          if (hostWindow == null)
              return;
  
          hostWindow.CommandBindings.Add(new CommandBinding(ShutDownCommand, OnShutDownCommandExecuted, OnShutDownCommandCanExecute));
      }
  
      private static void OnShutDownCommandExecuted(object sender, ExecutedRoutedEventArgs e) {
          MessageBox.Show("ShutDown Excuted!");
      }
  
      private static void OnShutDownCommandCanExecute(object sender, CanExecuteRoutedEventArgs e) {
          e.CanExecute = true;
      }
  }
  
  &lt;MenuItem Command="local:CommandLibrary.ShutDownCommand" /&gt;
  </code></pre>