title: how to select using a wrap panel as the item panel for listview
body: <p>I want to show a list of items horizontally and be able to select from this list of items - I have tried using a listview and changing the item template per some posts on stack and I have this:</p>
  
  <pre><code>&lt;ListView Height="Auto" HorizontalAlignment="Left" Margin="24,0,0,0" Name="MachinesListView" VerticalAlignment="Top" Width="1455" Background="#FFF0F0F0" ItemsSource="{Binding Machines}" BorderBrush="#FFF0F0F0" Grid.ColumnSpan="2" Grid.Row="2" SelectionChanged="MachinesListView_SelectionChanged"&gt;
                  &lt;ListView.ItemsPanel&gt;
                      &lt;ItemsPanelTemplate&gt;
                          &lt;WrapPanel Width="{Binding (FrameworkElement.ActualWidth), 
                      RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                      ItemWidth="{Binding (ListView.View).ItemWidth, 
                      RelativeSource={RelativeSource AncestorType=ListView}}"
                      MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
                      ItemHeight="{Binding (ListView.View).ItemHeight, 
                      RelativeSource={RelativeSource AncestorType=ListView}}" /&gt;
                      &lt;/ItemsPanelTemplate&gt;
                  &lt;/ListView.ItemsPanel&gt;
                  &lt;ListView.ItemContainerStyle&gt;
                      &lt;Style TargetType="{x:Type ListViewItem}"&gt;
                          &lt;Setter Property="Height" Value="175"/&gt;
                          &lt;Setter Property="Width" Value="275"/&gt;
                          &lt;Setter Property="Margin" Value="5,5,0,0"/&gt;
                          &lt;Setter Property="Template"&gt;
                              &lt;Setter.Value&gt;
                                  &lt;ControlTemplate&gt;
                                      &lt;Border BorderBrush="Gray" BorderThickness="2" CornerRadius="10"&gt;
                                          &lt;StackPanel Orientation="Vertical"&gt;
                                              &lt;TextBlock Text="{Binding Machine.MachineId}" TextAlignment="Center" Width="Auto" Foreground="#FF639A70" FontSize="19"/&gt;
                                              &lt;TextBlock Text="{Binding Machine.Name}" TextAlignment="Center" Width="Auto" Foreground="Gray" FontSize="15" /&gt;
                                              &lt;Image Source="/URM;component/Images/slot_machine-512.png" Height="60" Width="60" /&gt;
                                              &lt;TextBlock Text="{Binding Machine.Description}" TextAlignment="Center" Width="Auto" Foreground="Gray" FontSize="15" Margin="0, 5, 0, 0"/&gt;
                                              &lt;TextBlock TextAlignment="Center" Width="Auto" Foreground="Gray" FontSize="15" Margin="0, 5, 0, 0"&gt;
                                                  &lt;Run Text ="Actual: "/&gt;
                                                  &lt;Run Text ="{Binding Actual, StringFormat=' {0:c}'}"/&gt;
                                              &lt;/TextBlock&gt;
                                              &lt;TextBlock TextAlignment="Center" Width="Auto" Foreground="Gray" FontSize="15" Margin="0, 5, 0, 0"&gt;
                                                  &lt;Run Text ="OverShort: "/&gt;
                                                  &lt;Run Text ="{Binding OverShort, StringFormat=' {0:c}'}"/&gt;
                                              &lt;/TextBlock&gt;
                                          &lt;/StackPanel&gt;
                                      &lt;/Border&gt;
                                  &lt;/ControlTemplate&gt;
                              &lt;/Setter.Value&gt;
                          &lt;/Setter&gt;
                      &lt;/Style&gt;
                  &lt;/ListView.ItemContainerStyle&gt;
              &lt;/ListView&gt;
  </code></pre>
  
  <p>This works well...I get the overall look and feel that I want from this but only selecting the first item causes the selectionchanged event to fire...</p>
  
  <p>I thought about implementing the items as buttons instead but I thought there might be a more proper way of dealing with this.</p>