title: Binding Commands to ComboBoxItem in WPF
body: <p>I have a simple ComboBox that I want to trigger separate commands each time the selected value changes. Here is an example of my markup:</p>
  
  <pre><code>&lt;WrapPanel Grid.Row="0" Visibility="{Binding ShowToggleViewFeedViewManual}"&gt;
      &lt;ComboBox Margin="3,3,0,0"&gt;
          &lt;ComboBoxItem IsEnabled="{Binding CanSelectViewFeedData}" &gt;
              &lt;ComboBoxItem.CommandBindings&gt;
                  &lt;CommandBinding Command="SelectViewFeedDataCommand" /&gt;
              &lt;/ComboBoxItem.CommandBindings&gt;
              &lt;TextBlock Text="View Feed Data"/&gt;
          &lt;/ComboBoxItem&gt;
          &lt;ComboBoxItem IsEnabled="{Binding CanSelectViewManualData}"&gt;
              &lt;ComboBoxItem.CommandBindings&gt;
                  &lt;CommandBinding Command="SelectManualFeedDataCommand" /&gt;
              &lt;/ComboBoxItem.CommandBindings&gt;
              &lt;TextBlock Text="View Manual Data"/&gt;
          &lt;/ComboBoxItem&gt;
      &lt;/ComboBox&gt;
  &lt;/WrapPanel&gt;   
  </code></pre>
  
  <p>I get an error stating "<em>Cannot convert 'SelectViewFeedDataCommand'</em>". I get a similar error for the other ComboBoxItem as well. The ICommand is defined in the ViewModel Class that is the DataSource for the UserControl, bound as a DataTemplate.</p>
  
  <pre><code>public ICommand SelectViewFeedDataCommand
  {
      get
      {
          // Code to perform
      }
  }
  </code></pre>
  
  <p>I have researched this pretty extensively but haven't found an answer for how to effectively bind the ICommand to the ComboBoxItem.</p>
  
  <p>I am adapting this from existing code that used a set of radiobuttons and associated commands, which is done pretty easily. Is there no simple way to do this with a ComboBox?</p>
  
  <p>Thanks.</p>