How To Create Templated Controls
Data Binding
When you're creating a control template and you want to bind to the templated parent you can use:
<TextBlock Name="tb" Text="{TemplateBinding Caption}"/>
<!-- Which is the same as -->
<TextBlock Name="tb" Text="{Binding Caption, RelativeSource={RelativeSource TemplatedParent}}"/>