Find an element in DataTemplate applied to TabItem
I got a problem trying to find an element declared in DataTemplate, that after was applied like a ContentTemplate to TabItem object. I saw that there is already some solutions in regard of this problem, but no one of them actually works in my case, and I would like to understand why (obviously I make mistake in some place) Here is a sample code: <DataTemplate x:Key="TabItemDataTemplate"> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="templateGrid"> <Grid.RowDefinitions> <RowDefinition Height="6.0*"> </RowDefinition> <RowDefinition Height="6" ></RowDefinition>