title: EventToCommand to get the item clicked inside an ItemsControl
body: <p>This is the layout I have in the XAML:</p>
  
  <pre><code>&lt;ScrollViewer Name="svDesigner" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Focusable="False"&gt;
      &lt;ItemsControl ItemsSource="{Binding DesignerRowsCollection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"&gt;
          &lt;ItemsControl.ItemTemplate&gt;
              &lt;DataTemplate DataType="{x:Type base:UI_DesignerRow}"&gt;
                  &lt;cntrl:BabDesignerRow Margin="2"/&gt;
              &lt;/DataTemplate&gt;
          &lt;/ItemsControl.ItemTemplate&gt;
          &lt;dxmvvm:Interaction.Behaviors&gt;
              &lt;dxmvvm:EventToCommand EventName="MouseLeftButtonDown" 
                                 Command="{Binding SetPropertiesSourceCommand}" PassEventArgsToCommand="True"&gt;
                  &lt;dxmvvm:EventToCommand.EventArgsConverter&gt;
                      &lt;conv:DesignerItemClickEventArgsConverter/&gt;
                  &lt;/dxmvvm:EventToCommand.EventArgsConverter&gt;
              &lt;/dxmvvm:EventToCommand&gt;
          &lt;/dxmvvm:Interaction.Behaviors&gt;
      &lt;/ItemsControl&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the code behind I have this Sub which handles the ScrollViewer's PreviewMouseLeftButtonDown event:</p>
  
  <pre><code>Private Sub DesignerItemSelectionRedirect(sender As Object, e As MouseButtonEventArgs) Handles svDesigner.PreviewMouseLeftButtonDown
  </code></pre>
  
  <p>Inside my UserControl BabDesignerRow I have a lot of different UI object like TextBox, ComboBox, LayoutGroup and so on.</p>
  
  <p>Right now, no matter where I click, I always get the entire ItemsControl as e.Source and not the real object selected.</p>
  
  <p>Is there a way to get the object clicked inside my UserControl?</p>
  
  <p>I need to get this information in order to highlight what the user selects.</p>