title: How can I reference an element inside a control template
body: <p>Say I wanna put a <code>CheckBox</code> inside a <code>Button</code>. Is there anyway for me to reference that checkbox in code? i.e. In Window1.cs I want to write something like: <code>testButton.innerCheckBox.DoStuff()</code>;</p>
  
  <pre><code>    &lt;ControlTemplate TargetType="{x:Type Button}"&gt;                          
          &lt;Microsoft_Windows_Themes:ButtonChrome SnapsToDevicePixels="true" x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor"&gt;
          &lt;Grid Width="32.083" Height="13.277"&gt;
              &lt;ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" VerticalAlignment="Stretch" RecognizesAccessKey="True" d:LayoutOverrides="Width, Height"/&gt;
              &lt;CheckBox x:Name="innerCheckBox" HorizontalAlignment="Left" VerticalAlignment="Top" Content="CheckBox"/&gt;
          &lt;/Grid&gt;
          &lt;/Microsoft_Windows_Themes:ButtonChrome&gt;
      &lt;/ControlTemplate&gt;
  </code></pre>