I'm trying to make only the header of the TabItem send an event.
So far I have my xaml...
<TabControl>
<TabItem Header="tab 1">
Any text
</TabItem>
<TabItem Header="tab 2">
<TextBox>blah</TextBox>
</TabItem>
<TabControl.Resources>
<Style TargetType="TabItem">
<EventSetter Event="MouseDoubleClick" Handler="TabItemMouseDoubleClick"/>
</Style>
</TabControl.Resources>
</TabControl>
...and my event handler...
void TabItemMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
}
Now, when double clicking the tab item header the event fires, when clicking the tab item content area it doesn't fire (which is what I want), but when I put a text box in the TabItem, the event fires upon double clicking the textbox. I'm trying to get only the header of the TabItem to fire the event - any ideas?
Thanks in advance.