Quantcast
Viewing all articles
Browse latest Browse all 18858

How to access child control of template in code behind ?

Hi All,

            I am using button template in resource dictionary and this template  key  access  in button i want to child control access in code behind (.cs) such as:

            Template in  Resource Dictionary :

             <ControlTemplate x:Key="btnTemplate" TargetType="Button">
                   <Grid>
                            <TextBlock x:Name="tb" Height="25" Width="150" ></TextBlock>
                   </Grid>
              </ControlTemplate>

 

             .xaml  

             <Button x:Name="btn" Template="{DynamicResource  btnTemplate}" Height="25" Width="150" >

                    I want to   textblock (x:Name="tb") name access in code behind.

    Thanks

            


aniruddha


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>