TabItem Selected not Working Properly
<p>I have a <code>TabControl</code> that contains three <code>TabItems</code>. I have a label on each <code>TabItem</code> so I can program the click event, it looks like this; </p>

<pre><code>&lt;TabItem.Header&gt;
    &lt;Label Content="People" HorizontalAlignment="Stretch" FontSize="14" MouseLeftButtonDown="TabItemClick"/&gt;
&lt;/TabItem.Header&gt;
</code></pre>

<p>I want to program the <code>TabItem</code> click so that something happens depending on which <code>TabItem</code> is selected, so I wrote something like this;</p>

<pre><code>private void TabItemClick(object sender, MouseButtonEventArgs e)
{
    var privilegeService = new PrivilegeService();
    if (companyTabItem.IsSelected == true)
    {
        generateCompanyPrivilegesButton.IsEnabled = true;
        applyCompanyPrivilegesButton.IsEnabled = false;
    }
    else if (peopleTabItem.IsSelected == true)
    {
        MessageBox.Show("People Selected");
        generatePeoplePrivilegesButton.IsEnabled = false;
        applyPeoplePrivilegesButton.IsEnabled = false;
    }
    else if (contractTabItem.IsSelected == true)
    {
        generateContractsPrivilegesButton.IsEnabled = false;
        applyContractsPrivilegesButton.IsEnabled = false;
    }
}
</code></pre>

<p>As you can see I added in a <code>MessageBox</code> for some testing purposes to see when a <code>TabItem</code> is selected. The <code>MessageBox</code> is only displayed however after I LEAVE the <code>peopleTabItem</code>, not when I click onto it. How can I change this so that I can program someting that happens when the <code>TabItem</code> is clicked AND when it is selected too?</p>