title: C#/WPF: Get Selected Row from a ListView
body: <p>I've following ListView Item (in a WPF Form):</p>
  
  <pre><code>   &lt;ListView Name="listViewTeam" ItemsSource="{Binding Path=TeamList}"&gt;
          &lt;ListView.View&gt;
              &lt;GridView  ColumnHeaderTemplate ="{StaticResource BlueHeader}"&gt;
                  &lt;GridView.ColumnHeaderContainerStyle&gt;
                      &lt;Style TargetType="{x:Type GridViewColumnHeader}"&gt;
                          &lt;Setter Property="HorizontalContentAlignment" Value="Left" /&gt;
                      &lt;/Style&gt;
                  &lt;/GridView.ColumnHeaderContainerStyle&gt;
                  &lt;GridViewColumn Width="34"  Header="Nr" DisplayMemberBinding="{Binding Path=TeamNr , Mode=OneWay}"/&gt;
                  &lt;GridViewColumn Header="Team" DisplayMemberBinding="{Binding Path=TeamName, Mode=OneWay}"/&gt;
              &lt;/GridView&gt;
          &lt;/ListView.View&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>DataContext is a TeamViewModel, which contains<br>
  a) a List of Teams<br>
  b) a SelectedTeam Property (which is a Team-Object and contains Team.TeamName and Team.TeamNr )  </p>
  
  <p>Loading of the TeamViewModel.TeamListe into the ListView works fine (I get all Team-Objects from the list displayed in my ListView)  </p>
  
  <p>How can I set the TeamViewModel.SelectedTeam Property to the Row-Value, which is selected?</p>
  
  <p>Thanks!</p>
  
  <p>Cheers</p>