title: WPF custom command in context menu are disabled until any button clicked
body: <p>I have a custom command and I try to execute them from the context menu, but they are always displayed as disabled unless I click any button on the UI (buttons do not have anything to do with commands). </p>
  
  <p>After clicking a button, commands start to be displayed correctly (when they are unavailable they get disabled and enabled if available).</p>
  
  <p>Edit: it turns out that it is not the button click which makes command work correctly, but button or other controls in focus (e.g. if I tab into a control this also enables my commands).</p>
  
  <p>Here is the code for commands:</p>
  
  <pre><code>&lt;Window.InputBindings&gt;
      &lt;KeyBinding Command="{x:Static local:MainWindow.Quit}" Key="Q" Modifiers="Ctrl"/&gt;
      &lt;KeyBinding Command="{x:Static local:MainWindow.Disconnect}" Key="D" Modifiers="Ctrl"/&gt;
  &lt;/Window.InputBindings&gt;
  
  &lt;Window.ContextMenu&gt;
      &lt;ContextMenu Opacity="95"&gt;
          &lt;MenuItem Header="Quit Application                  Ctrl + Q"   Command="{x:Static local:MainWindow.Quit}"/&gt;
          &lt;MenuItem Header="Disconnect from the pump   Ctrl + D" Command="{x:Static local:MainWindow.Disconnect}"/&gt;
      &lt;/ContextMenu&gt;
  &lt;/Window.ContextMenu&gt;
  </code></pre>
  
  <p>Here is the commands CanExecuteMethod:</p>
  
  <pre><code>public static RoutedCommand Quit = new RoutedCommand();   
  
  private void QuitCanExecute(object sender, CanExecuteRoutedEventArgs e)
       {
        e.CanExecute = true;
        e.Handled = true;
       }
  </code></pre>