title: Responding to a routed command in a viewmodel
body: <p>I want to handle a routed command from a button, in my viewmodel. I can get it working in the Usercontrol's codebehind as follows:</p>
  
  <pre><code>Dim NewCommandBinding As CommandBinding = New CommandBinding(GlobalCommands.ResultsFilterChangedCommand,
                                                                       AddressOf ExecuteResultsFilterChanged,
                                                                       AddressOf CanExecuteResultsFilterChanged)
          CommandBindings.Add(NewCommandBinding)
  </code></pre>
  
  <p>And then bind to it in XAML:</p>
  
  <pre><code>&lt;ToggleButton x:Name="FilterTgl" Content="Archives" Margin="10,4" Padding="10,2"
                              Command="cmds:GlobalCommands.ResultsFilterChangedCommand" /&gt;
  </code></pre>
  
  <p>But when I move the code to the viewmodel, I get 'Commandbindings is not declared'. Presumably because my UserControl is UI and my ViewModel is not.</p>
  
  <p>Should I not be trying to handle a command directly in my viewmodel? Thanks for any advice.</p>