title: How to pass listbox selecteditem as command parameter in a button?
body: <p>Here is my situation:</p>
  
  <pre><code>&lt;ListBox ItemsSource="{Binding Path=AvailableUsers}"&gt;
      &lt;ListBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;TextBlock Text="{Binding Path=Id}"/&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  &lt;Button Command="{Binding Path=Load}" CommandParameter={???? What goes here ????}/&gt;
  </code></pre>
  
  <p>What I want is to pass the Id that is currently selected in the ListBox. I have a viewmodel behind the scenes that essentially looks like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class ViewModel : DependencyObject
  {
      ICommand Load { get; set; }
  
      // dependency property but I didn't bother to write it out like one
      List&lt;User&gt; AvailableUsers { get; set}
  }
  </code></pre>
  
  <p>How can I send the currently selected item using the xaml?</p>