How can I find any control in the ItemTemplate of a TabControl?
- by mrok
Hi,
I have a TabControl
<TabControl
Name="myTabControl"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding}"
Margin="4">
<TabControl.ItemTemplate>
<DataTemplate>
<DockPanel Width="120">
<Button Name="CloseScreen"/>
<ContentPresenter Content="{Binding Path=DisplayName}" VerticalAlignment="Center" />
</DockPanel>
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
I want to find the button which is located in the ItemTemplate from code.
Thank you.