title: How do I access an element of a control template from within code-behind
body: <p>I'm trying to access a user control which is inside the control template of a content control. Specifically:</p>
  
  <pre><code>  &lt;ContentControl x:Name="MyList" &gt;
          &lt;ContentControl.Template&gt;
              &lt;ControlTemplate x:Name="MyControlTemplate"&gt;
                  &lt;Border RenderTransformOrigin="0,0" x:Name="border"&gt;
                      &lt;UserControls:MyControl x:Name="MyControlName" Width="100" ViewModel="{Binding}" /&gt;
  </code></pre>
  
  <p>I can access this.MyList but it says this.MyControlName is not found. How do I access the MyControlName object from code-behind in this situation?</p>
  
  <p>Thanks!</p>