title: How to get previous selected TabItem Index from TabControl?
body: <p>Following xaml code for your testing needs.</p>
  
  <pre><code>&lt;Window x:Class="MainWindow"  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="MainWindow" Height="200" Width="350"&gt;
  &lt;DockPanel&gt;
      &lt;TabControl x:Name="TabControl" DockPanel.Dock="top"&gt;
          &lt;TabItem x:Name="TabItem1" Header="London"&gt;
              &lt;Label Content="London" /&gt;
          &lt;/TabItem&gt;
          &lt;TabItem x:Name="TabItem2" Header="Paris"&gt;
              &lt;Label Content="Paris" /&gt;
          &lt;/TabItem&gt;
          &lt;TabItem x:Name="TabItem3" Header="Tokyo"&gt;
              &lt;Label Content="Tokyo" /&gt;
          &lt;/TabItem&gt;
          &lt;TabItem x:Name="TabItem4" Header="Istanbul"&gt;
              &lt;Label Content="Istanbul" /&gt;
          &lt;/TabItem&gt;
      &lt;/TabControl&gt;
  &lt;/DockPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>How to get previous TabItem Index from TabControl and show in the MessageBox?</p>
  
  <p>I need vb.net code running from code behind.</p>