title: MVVM - How ListView ItemClick Execute RelayCommand with Bindig
body: <p>I would like to add a command to my listview. When an item is clicked I would like to execute my relayCommand.
  Now I have these solution, it works, but I think it is not so MVVM :)</p>
  
  <pre><code>&lt;ListView ItemsSource="{Binding Taxons}" IsItemClickEnabled="True" ItemClick="ListViewBase_OnItemClick"&gt;
         &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                    &lt;TextBlock Text="{Binding Name}"/&gt;
              &lt;/DataTemplate&gt;
         &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>Code Behind:</p>
  
  <pre><code>private void ListViewBase_OnItemClick(object sender, ItemClickEventArgs e)
  {
         viewModel.TreeItemSelected.Execute(((Taxon)e.ClickedItem).Name);
  }
  </code></pre>
  
  <p>I would like to use this way without any code behind, but it is not possible as the VS tells me:</p>
  
  <pre><code>&lt;ListView ItemsSource="{Binding Taxons}" IsItemClickEnabled="True" ItemClick="{Binding TreeItemSelected}"&gt;
         &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                    &lt;TextBlock Text="{Binding Name}"/&gt;
              &lt;/DataTemplate&gt;
         &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>I use the following extra dll-s, but i dont want to install anything else if it possible.
  GalaSoft.MvvmLight.Extras.Win8
  GalaSoft.MvvmLight.Win8</p>
  
  <p>Can you suggest a solution to me? </p>