How can I find any control in the ItemTemplate of a TabControl?

Posted by mrok on Stack Overflow See other posts from Stack Overflow or by mrok
Published on 2010-05-27T13:50:37Z Indexed on 2010/05/27 13:51 UTC
Read the original article Hit count: 345

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about datatemplate