title: WPF - Get index of each item selected in a ListView
body: <p>I'm trying to get an int list of selected indexes in a ListView. Something like this:</p>
  
  <pre><code>            List&lt;int&gt; SelectedIndexes = new List&lt;int&gt;();
              foreach (var item in Client_List.SelectedItems)
              {
                  SelectedIndexes.Add(item);
              }
  </code></pre>
  
  <p>and the output should be something like: 1 5 7 9 12, i cant figure out how to do it in wpf, in windows forms you could just use client_list.SelectedIndices.</p>
  
  <p>What im trying to do is open a new window and send a client info array to it. Below is win forms code. </p>
  
  <pre><code>            List&lt;Networking.ClientInformation&gt; SelectedClients = new List&lt;Networking.ClientInformation&gt;();
              for (int i = 0; i &lt; client_list.SelectedIndices.Count; i++)
              {
                  SelectedClients.Add(Connections.Clients[client_list.SelectedIndices[i]]);
              }
  </code></pre>