title: How to get the index of the current ItemsControl item?
body: <p>Is there any way to get the index of the current <code>ItemsControl</code> item in <code>WPF</code>?</p>
  
  <p>For example, I want to do something like:</p>
  
  <pre><code>&lt;ItemsControl&gt;
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;TextBox Text="{Binding current_index}"&gt;
              &lt;/TextBox&gt;
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>so that after this, the first <code>TextBox</code> will show text <code>"0"</code>, second <code>"1"</code>, third <code>"2" ...</code>.</p>