RelativeSource in DataTemplate works with TabControl but not with TabItem
I am having a TabControl and within it a TabItem having a ContentControl. This ContentControl is applied a datatemplate. The code is here: <TabControl x:Name="tabControl1" Tag="Giving URI here works"> <TabItem x:Name="tabItem1" Tag="Giving URI here doesnt work"> <ContentControl ContentTemplate="{StaticResource myOptionsDataTemplate}"> <StackPanel> <TextBlock Text="Some Text" /> </StackPanel> </ContentControl> </TabItem> </TabControl> And the data template is: <DataTemplate x:Key="myOptionsDataTemplate"> <Border> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height