title: wpf usercontrol, bind command parameter of button to the parent usercontrol
body: <p>I've got a WPF UserControl which contains a remove button, I'd like to pass the entire UserControl as the CommandParameter.</p>
  
  <p>Currently the binding is set to CommandParameter="{Binding RelativeSource={RelativeSource Self}}" which gives me the button, but how can I get the entire control?</p>
  
  <p>Can anyone assist please?</p>
  
  <p>Cheers,</p>
  
  <p>Andy</p>
  
  <pre><code>&lt;UserControl x:Class="GTS.GRS.N3.Controls.LabelledTextBox"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
  &lt;Grid&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="100" /&gt;
          &lt;ColumnDefinition Width="155" /&gt;
          &lt;ColumnDefinition /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Label Name="label" HorizontalAlignment="Left" Width="96"&gt;Label&lt;/Label&gt;
      &lt;TextBox Name="textBox" Grid.Column="1" /&gt;
      &lt;Button Grid.Column="2" Style="{DynamicResource CloseButton}" Command="{Binding RemoveCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Visibility="{Binding RemoveVisible}"&gt;&lt;/Button&gt;
  &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>