title: C#/WPF: KeyBinding not triggering Command
body: <p>I have declared <code>&lt;InputBindings&gt;</code></p>
  
  <pre><code>&lt;UserControl.InputBindings&gt;
      &lt;KeyBinding Key="C" Modifiers="Ctrl" Command="{Binding CopyImageCommand}" /&gt;
      &lt;KeyBinding Key="V" Modifiers="Ctrl" Command="{Binding PasteImageCommand}" /&gt;
  &lt;/UserControl.InputBindings&gt;
  </code></pre>
  
  <p>For testing purposes, I have added buttons bound to those commands too</p>
  
  <pre><code>&lt;Button Command="{Binding CopyImageCommand}" Content="Copy" /&gt;
  &lt;Button Command="{Binding PasteImageCommand}" Content="Paste" /&gt;
  </code></pre>
  
  <p>I noticed that when the paste button is enabled, when i press Ctrl-V nothing happens. Ctrl-C seems to work. For that, a list box item is selected, I am not sure if it makes any difference. Anyone knows why is my <code>PasteImageCommand</code> not triggering? </p>
  
  <p><em>I am using .NET 4 btw</em></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>A fuller code snipplet</p>
  
  <pre><code>&lt;UserControl x:Class="QuickImageUpload.Views.ShellView"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               xmlns:vm="clr-namespace:QuickImageUpload.ViewModels"
               mc:Ignorable="d" 
               d:DesignHeight="300" d:DesignWidth="300"&gt;
      &lt;UserControl.InputBindings&gt;
          &lt;KeyBinding Key="C" Modifiers="Ctrl" Command="{Binding CopyImageCommand}" /&gt;
          &lt;KeyBinding Key="V" Modifiers="Ctrl" Command="{Binding PasteImageCommand}" /&gt;
      &lt;/UserControl.InputBindings&gt;
      &lt;UserControl.DataContext&gt;
          &lt;vm:ShellViewModel /&gt;
      &lt;/UserControl.DataContext&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="50" /&gt;
              &lt;RowDefinition Height="*" /&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I found out I need to put the <code>KeyBindings</code> in the MainWindow, but the commands are in the <code>ViewModel</code>, how can i set key bindings in the <code>ShellView</code> which then binds to commands in the <code>ShellViewModel</code>?</p>