title: Execute command with parameter using xaml binding and viewmodel
body: <p>Currently I have in xaml:</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding Facilities, Mode=OneWay}"&gt;
   &lt;ItemsControl.ItemTemplate&gt;
    &lt;DataTemplate&gt;
     &lt;Border Style="{StaticResource BorderStyleHeader}"&gt;
      &lt;Grid&gt;
       &lt;Grid.RowDefinitions&gt;
        &lt;RowDefinition Height="33" /&gt;
        &lt;RowDefinition Height="33" /&gt;
       &lt;/Grid.RowDefinitions&gt;
       &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition Width="150" /&gt;
        &lt;ColumnDefinition Width="*" /&gt;
       &lt;/Grid.ColumnDefinitions&gt;
       &lt;TextBlock Text="{Binding Name}" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="1" FontWeight="Bold" /&gt;
       &lt;TextBlock Text="{Binding Description}" Grid.Row="1" Grid.Column="1" /&gt;
       &lt;Button Content="Reserveer Nu" Style="{StaticResource ButtonStyle}" 
               Margin="5" Grid.Row="1" Grid.Column="0" 
               Command="{Binding Reservation.ItemClicked}" 
               CommandParameter="{Binding FacilityId}"/&gt;
      &lt;/Grid&gt;
     &lt;/Border&gt;
    &lt;/DataTemplate&gt;
   &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>Now the first thing is that I wish for the button to raise the event in my viewmodel</p>
  
  <pre><code>public RelayCommand ItemClicked
  {
      get
      {
          return new RelayCommand(() =&gt;
          {
              MessageBox.Show("Something is clicked");
          });
      }
  }
  </code></pre>
  
  <p>but it refuses...<br>
  secondly I want to be able to raise the event with a parameter (notice the commandparameter) but I have never used it and thus I dont understand how to use it.</p>
  
  <p>So my questions:</p>
  
  <ol>
  <li><p>Why isn't my relaycommand being executed?</p></li>
  <li><p>How do I make use of the command parameter?</p></li>
  </ol>